• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

GridBagLayout as Layoutmanager for JFrame  RSS feed

 
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.
 
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!