• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

control / set margins

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i want to design consistent layouts.
to set margins and space between components to specific values.
i try to follow the values laid out in 'Java look and feel design guideline'. (http://java.sun.com/products/jlf/ed2/book/HIG.Visual2.html)
how do i specify the margins from inside a TitledBorder to the components placed inside it?
i have tried to use GridBagLayout and to set GridBagConstraints properties such as ipadx, ipady and insets. i can make the margins larger, but not smaller. how can i get the margins smaller?
when i call the getInsets method of the TitledBorder i get the following results :
top : 21
left : 5
bottom : 5
right : 5
how can i change these?
i tried to use the getInsets(Component, Insets) method, but to no difference. (<titledborder>.getInsets(<a component added inside the border>, <new Insets(0, 0, 0, 0)> )
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you try using getBorderInsets(Component c) on your TitledBorder?
 
tormod eriksen
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have tried to use the getBorderInsets(Component, Insets), but I don't quite understand what function it has.
As Component I passed in the object of a component added on the component with the actual border.
As Insets I passed in new Insets(0, 0, 0, 0).
The margins looked the same, and the Insets object returned from the above method call, had the same Inserts values as the one returned from getBorderInsets(Component) (with the same component passed in as argument)
The getBorderInsets(Component) only returns a current value, it doesn't set one, right?
Does the Insets of the Component passed as argument matter?
Have I misunderstood how these methods functions and / or is to be used?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic