Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
Swing / AWT / SWT
No groupbox class?
Chris Stewart
Ranch Hand
Posts: 184
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Is there no groupbox class I can use in Swing? I did a search in google and looked through my book, no mention on a groupbox class.
Gregg Bolinger
Ranch Hand
Posts: 15304
6
I like...
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
A GroupBox? What functionallity are you trying to achieve?
Chris Stewart
Ranch Hand
Posts: 184
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You can find a screenshot here:
http://www.codeproject.com/cs/miscctrl/headeronlygroupbox.asp
I'm looking for something that does what "groupBox2" does in this pic.
Gregg Bolinger
Ranch Hand
Posts: 15304
6
I like...
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
That's Easy
Just create a JPanel with a TitledBorder. This sounds like something I might want to add to my JRSwing package.
If you want a code sample, let me know.
Chris Stewart
Ranch Hand
Posts: 184
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
A code sample would be great.
Gregg Bolinger
Ranch Hand
Posts: 15304
6
I like...
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Here is a small example
import javax.swing.*; import java.awt.event.*; import java.awt.*; public class GroupBoxTest extends JFrame { public GroupBoxTest() { addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent w) { System.exit(0); } }); this.getContentPane().setLayout(null); JPanel groupBoxPanel = new JPanel(); groupBoxPanel.setLayout(null); groupBoxPanel.setBorder(BorderFactory.createTitledBorder("Group Box 2")); JButton b = new JButton("Push Me"); b.setBounds(10, 20, 100, 20); groupBoxPanel.add(b); groupBoxPanel.setBounds(5, 5, 300, 300); this.getContentPane().add(groupBoxPanel); this.setBounds(100, 100, 500, 500); } public static void main(String[] args) { new GroupBoxTest().setVisible(true); } }
Chris Stewart
Ranch Hand
Posts: 184
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Perfect! Thank you.
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Adding ScrollBar to JTextArea
Is there something like a GroupBox in Swings ?!!
Setting font for MySQL Administrator GUI tool
bug in code.................
Bug in the code please help me out
More...