Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Panel border  RSS feed

 
satya sahu
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am using awt to develop a window having few lebels and textbox and buttons. I am putting few textbox and buttons in a panel. I want to give title to this panel. How can i do that. It is urgent. Please suggest me as soon as possible. Thanx.
 
narayana murthy pedapudi
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi satya,
u can try like this.
u need to import this class.
import javax.swing.border.TitledBorder;

TitledBorder titled = new TitledBorder("Please Enter");
titled.setTitleColor(Color.white);
urpanel.setBorder(titled);
urpanel is what ever panel u want to set the border.
all the best
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
narayana, he is asking about AWT... what you suggested only works on Swing.

satya, here's an example of how to do border in AWT...

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!