This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

GridBagLayout as Layoutmanager for JFrame  RSS feed

 
kiran medisetty
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to set the layout manager to GridBagLayout. The code is attached below. After seeting the default layout mgr [when the Frame object is first made], the layout manager seems to be not changing at all.
I run the 3 lines of code to set the GridbagLayout as the Layout manager. But the layout manager stays the same [the default is the Border Layout]..

Any thoughts?? is appreciated.

AbstractPrintFrame is a Abstract Class and it Extends JFrame
-----------------------------------------------------------------
public class PrintPage extends AbstractPrintFrame implements

Container test = getContentPane();
GridBagLayout test1 = new GridBagLayout();
test.setLayout(test1);
-------------------------------------------------------------------

Thanks.
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The GridBagLayout class api (in the javadocs) has an example app showing how to use it.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!