wood burning stoves*
The moose likes Beginning Java and the fly likes Any ideas on how to insert a JLabel directly above an existing GridLayout ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Any ideas on how to insert a JLabel directly above an existing GridLayout ?" Watch "Any ideas on how to insert a JLabel directly above an existing GridLayout ?" New topic
Author

Any ideas on how to insert a JLabel directly above an existing GridLayout ?

WeiJie Lim
Ranch Hand

Joined: Sep 05, 2012
Posts: 85
I have already arranged the 4 buttons and the top JLabel and JTextfield in a GridLayout.

But now I am trying to add a small phrase above the GridLayout. ( The circled phrase in red in the image image )

Any ideas on how to go about doing it ?


K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2229
    
    7

Did you try using another JPanel and put the JLabel and GridLayout panel in this JPanel?


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
WeiJie Lim
Ranch Hand

Joined: Sep 05, 2012
Posts: 85
I found the answer, it may help others in the future who stumble upon this thread, so I will just post it here

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Any ideas on how to insert a JLabel directly above an existing GridLayout ?
 
Similar Threads
background image
How do you add image in a JLabel?
jbutton in one line with jlabel
Background image on Tabs in JTabbedPane
Modifying a GridLayout/Changing Labels