• Post Reply Bookmark Topic Watch Topic
  • New Topic

Titled Border  RSS feed

 
Jeran Zyre
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey nice site wish i had found it a while ago...
anyway i just started learning swings and i have trouble caling the Title border... can someone help me please... i found one topic here that envolves the titled border, but it was on a panel... all i need is the title border.

thanx in advance
 
sasi kala
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set border to swing component using its setBorder() method.



For different types of borders see this link.




Note:
BorderFactory is from javax.swing.BorderFactory;


All The Best
 
Jeran Zyre
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sasi!

Thanks for replying that site really helps.. but i got another question how can u make two title border side by side not up and down? i tried to do it but i have no clue how... do i have to do a split panel or something? here's what i got so far from that site, i just made one titled border for no confusion...

thanks in again...
-jeran-

 
sasi kala
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi jeran,

i couldn't understand your question, we need some more explination.
as far as i know, its not possible to add two title borders side by side for the same component.

in which situation you need it? i.e., do u want to add some text at runtime or like ???

--
sasi
 
Jeran Zyre
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry bout that Sasi about that.. no all i need to do is to put two titled border side by side.. cause im planning to put a button on the left side of the panel (lets say the first title border) then on the second panel is a text area in side the second border.. so yah how can i do a side by side titled border?

thanks again
jeran
 
Jeran Zyre
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
simple the side by side titled border
 
Mike Southgate
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Borders belong to components. So what you're really after is putting two components side by side. This is handled by the LayoutManager. There's a tutorial on-line on this but I can't find it right now. In any event you need to look at the following: GridLayout, FlowLayout, GridBagLayout, BoxLayout and BorderLayout.

ms
 
Jeran Zyre
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ill check on it
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!