• 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

GridBagLayout as Layoutmanager for JFrame

 
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.
 
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic