This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes how to set this a borderq Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to set this a borderq" Watch "how to set this a borderq" New topic
Author

how to set this a borderq

Roldan Baldo
Ranch Hand

Joined: Aug 11, 2009
Posts: 99
how to put a border on these, so that i can add another datas in another border also, and my datas can be organize.

Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

Did you check out the addBorder() method, and the BorderFactory class?


[Jess in Action][AskingGoodQuestions]
Roldan Baldo
Ranch Hand

Joined: Aug 11, 2009
Posts: 99
yes, but i get confused.

i mean a border that can wrap that 3 label and 3 textfield, not the whole frame that will be having border.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36599
    
  16
We usually discuss this sort of thing in the Swing forum. Moving.

And have a look in the Java™ Tutorials; there is always something useful there.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2097
    
    7
Add the Border to the panel.
Brian Cole
Author
Ranch Hand

Joined: Sep 20, 2005
Posts: 862
Rob Camick wrote:Add the Border to the panel.

Exactly, except the panel has been added to BorderLayout CENTER so will fill the frame,
so would have to do something like frame.getContentPane().setLayout(new FlowLayout())
in addition to the panel.setBorder(BorderFactory.createEtchedBorder()) or whatever.

bitguru blog
 
 
subject: how to set this a borderq
 
Similar Threads
GridBagLayout...!
problem in textfield width...
GridBagLayout problem
help on reading textfield on 1 class from another class and using it to create a file
JFrame problem