Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Setting the null layout for JMenuBar in JApplet

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I need to set the null layout for the JMenuBar what i have found till now is that default layout is BoxLayout for the JMenuBar but it deosnt solve my problem. following is my code sample


Any help in this regard will be highly appericiated
 
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to set the bounds after adding the child to the parent.

What exactly are you trying to do by setting the layout to null?
 
Muhammad Imran Saeed
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I have to add some other component(s) to MenuBar at the right side i.e a Button and label and there will be some space in between them. And i have to align the Button to some other component ...
 
Maneesh Godbole
Bartender
Posts: 11445
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok.
Like I said calling the set bounds after adding the child to the parent will fix your problem.

Setting the layout to null will give you immense grief if the applet is resized.
You might want to consider some other suitable layout (BorderLayout.EAST and BorderLayout.WEST for example) which would give you the same results and will take care of the resizing for you.
 
To do a great right, do a little wrong - shakepeare. twisted little ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic