1 30 31 package com.jgoodies.uif_lite.component; 32 33 import java.awt.Component ; 34 import java.awt.Insets ; 35 36 import javax.swing.AbstractButton ; 37 import javax.swing.Action ; 38 import javax.swing.BorderFactory ; 39 import javax.swing.JButton ; 40 import javax.swing.JScrollPane ; 41 import javax.swing.JSplitPane ; 42 43 44 51 52 public final class Factory { 53 54 55 private static final Insets TOOLBAR_BUTTON_MARGIN = new Insets (1, 1, 1, 1); 56 57 61 public static JScrollPane createStrippedScrollPane(Component component) { 62 JScrollPane scrollPane = new JScrollPane (component); 63 scrollPane.setBorder(BorderFactory.createEmptyBorder()); 64 return scrollPane; 65 } 66 67 78 public static JSplitPane createStrippedSplitPane(int orientation, 79 Component comp1, Component comp2, double resizeWeight) { 80 JSplitPane split = UIFSplitPane.createStrippedSplitPane(orientation, comp1, comp2); 81 split.setResizeWeight(resizeWeight); 82 return split; 83 } 84 85 91 public static AbstractButton createToolBarButton(Action action) { 92 JButton button = new JButton (action); 93 button.setFocusPainted(false); 94 button.setMargin(TOOLBAR_BUTTON_MARGIN); 95 button.setText(""); 98 return button; 99 } 100 101 } | Popular Tags |