Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
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:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
Doubt in GUI
Anupam Rathi
Greenhorn
Posts: 9
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I tried following code.
The button with label "East Button" does not show up in Panel.
Can anyone explain?
import javax.swing.*; import java.awt.*; public class SimpleGuiC extends JPanel { public void go() { JFrame frame = new JFrame(); JButton east = new JButton("East Button"); JPanel panel = new JPanel(); panel.setBackground(Color.darkGray); panel.add(east); frame.getContentPane().add(BorderLayout.EAST, panel); frame.getContentPane().add(BorderLayout.WEST, east); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(300, 300); frame.setVisible(true); } public static void main(String[] args) { SimpleGuiC gui = new SimpleGuiC(); gui.go(); } }
Thanks in advance
[ September 05, 2007: Message edited by: Anupam Rathi ]
=======<br />SCJP 5.0
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Is this really where actionlistener should go?
Can't get an ActionListener to change a JLabel text
NullPointerException received trying to change the button label
Help with a simple gui
Image Class is a Abstract Class ? ?
More...