when ı add two panels into a frame last panel i added seen on the screeen how can i show both panels in one frame
enes
0
Newbie Poster
Recommended Answers
Jump to PostThere gone be something wrong with your code. Can you please post it?
PS: Use code tags, press hash "#" sign on post toolbar and paste your code between the tags which will appear
Jump to PostIt's probobly a layout issue. Try to use something like this
class MyFrame extends JFrame { public MyFrame() { setSize(800,600); setTitle("MyFrame"); JPanel panel1 = new JPanel(); JPanel panel2 = new JPanel(); Container cp = getContentPane(); [B] cp.setLayout(new FlowLayout());[/B] cp.add(panel1); cp.add(panel2); } }
All 5 Replies
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
Artmann
0
Newbie Poster
jwenting
1,889
duckman
Team Colleague
Artmann
0
Newbie Poster
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.