1 36 37 40 41 42 import javax.swing.plaf.*; 43 import javax.swing.plaf.metal.*; 44 import javax.swing.*; 45 import javax.swing.border.*; 46 import java.awt.*; 47 48 56 public class DemoMetalTheme extends DefaultMetalTheme { 57 58 public String getName() { return "Presentation"; } 59 60 private final FontUIResource controlFont = new FontUIResource("Dialog", Font.BOLD, 18); 61 private final FontUIResource systemFont = new FontUIResource("Dialog", Font.PLAIN, 18); 62 private final FontUIResource userFont = new FontUIResource("SansSerif", Font.PLAIN, 18); 63 private final FontUIResource smallFont = new FontUIResource("Dialog", Font.PLAIN, 14); 64 65 public FontUIResource getControlTextFont() { return controlFont;} 66 public FontUIResource getSystemTextFont() { return systemFont;} 67 public FontUIResource getUserTextFont() { return userFont;} 68 public FontUIResource getMenuTextFont() { return controlFont;} 69 public FontUIResource getWindowTitleFont() { return controlFont;} 70 public FontUIResource getSubTextFont() { return smallFont;} 71 72 public void addCustomEntriesToTable(UIDefaults table) { 73 super.addCustomEntriesToTable(table); 74 75 final int internalFrameIconSize = 22; 76 table.put("InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(internalFrameIconSize)); 77 table.put("InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(internalFrameIconSize)); 78 table.put("InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(internalFrameIconSize)); 79 table.put("InternalFrame.minimizeIcon", MetalIconFactory.getInternalFrameAltMaximizeIcon(internalFrameIconSize)); 80 81 82 table.put( "ScrollBar.width", new Integer (21) ); 83 84 85 86 } 87 88 } 89 | Popular Tags |