Simple question here. How do I change the title of a JPanel
, for exmple
http://docs.oracle.com/javase/tutorial/figures/uiswing/components/ConverterColored.png
change the text "converter" here to something else?
Thanks in advance!
EDIT: sorry, it was a JPanel
!
First of all, the link you provided contains a JFrame
not JPanel
.
Second, pass the title as a parameter to the JFrame
constructor once you create it JFrame(String title)
:
JFrame myFrame = new JFrame("My Title");
or use the method setTitle(String title)
inherited from class Frame
:
myFrame.setTitle("My Title");
The element in the screen you linked to looks like a JFrame
, and not a JPanel
. The setTitle()
method should do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With