This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes About Jpanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "About Jpanel" Watch "About Jpanel" New topic
Author

About Jpanel

sajeevi bangamuwage
Greenhorn

Joined: Jan 19, 2005
Posts: 21
Hi all,
I put jTabbedPane & jScrollPane to JFrame. but when i put buttons and labels or any thing i cant adjust them as i want.
Is there layouts to jTabbedPane & jScrollPane as jFrames. How to set null.Im using net beans to do my project.I set the layout to null in jFrame.so i put components as i like. Plz tel me how to like that in jTabbedPane & jScrollPane .


Thank you
Sajeevi.
Jared Cope
Ranch Hand

Joined: Aug 18, 2004
Posts: 243
Hi,

Laying out componants is one of the things that I hate doing. At the end of the day, you have to learn how to use the Java layout managers and pick one that you are comfortable using.

I personally go for the GridBagLayout manager most times. There is a bit of a learning curve, but once you master it you can do most anything you need to do.

Good luck,

Cheers, Jared.


SCJP 1.4 91%, SCJP 1.5 88%, SCJD B&S
David Mace
Ranch Hand

Joined: May 26, 2004
Posts: 35
One thing you could consider doing is using the Absolute Layout Manager that ships with NetBeans. It seems to me that they didn't recommend packaging it with you apps, but I may just be imagining that. Anyways, it was originally intended to be used within the IDE itself so that you can layout the components visually without all the tricky-ness inherit in the different layout managers.

What I do a lot of the time is use this Absolute manager and then lay everything out. When I'm done, I switch the layout on the container to be Gridbag and it closely approximates what I had done with the other manager.

HTH,
David


Dad always thought laughter was the best medicine, which I guess is why several of us died of tuberculosis. -Jack Handy
 
Consider Paul's rocket mass heater.
 
subject: About Jpanel