1 package de.webman.wminstaller.app; 2 3 import javax.swing.*; 4 import java.awt.*; 5 import java.util.HashMap ; 6 7 13 class CardsPanel 14 extends JPanel 15 { 16 17 Installer wmi; 18 CardLayout cl = new CardLayout( 20, 20); 19 HashMap elements = new HashMap (); 20 21 public CardsPanel(Installer wmi) { 22 this.wmi = wmi; 23 this.setLayout(cl); 24 } 25 26 public CardLayout getCardLayout() { 27 return cl; 28 } 29 30 public void showCard( int c) { 31 cl.show(this, "" + c); 32 } 33 34 public Component addCard(Component com, int idx) { 35 String key = "" + idx; 36 elements.put(key, com); 37 System.out.println("----> added: " + idx); 38 super.add(com, key); 39 return com; 40 } 41 42 public Component getCard(int idx) { 43 return (Component) elements.get("" + idx); 44 } 45 } 46 47 48 | Popular Tags |