Results 1 to 2 of 2
- 11-08-2010, 10:05 AM #1Member
- Join Date
- Nov 2010
- Rep Power
Using a FlowLayout on top of a CardLayout
I want to use multiple panels as cards in a cardlayout. Therefore I created one Panel with cardLayout and multiple panels with flowlayout, and added those to the first panel.
The following code is part of my "gui extends JFrame" class:
JPanel cards = new JPanel(new CardLayout()); UnitCard unitPanel = new UnitCard(new FlowLayout(FlowLayout.LEFT, 10, 10)); cards.add(unitPanel, "unitPanel"); this.getContentPane().add(cards); this.setLayout(new FlowLayout());
Thanks for your help!
Create and post an SSCCE (please see the link in my signature below).
- By Kyle227 in forum New To JavaReplies: 4Last Post: 05-28-2010, 01:03 AM
- By sessomw5098 in forum New To JavaReplies: 4Last Post: 04-21-2010, 01:57 AM
- By glhansen in forum New To JavaReplies: 3Last Post: 03-23-2009, 11:19 PM
- By chris12295 in forum New To JavaReplies: 1Last Post: 12-07-2007, 06:49 PM
- By toad in forum New To JavaReplies: 2Last Post: 12-03-2007, 01:43 AM