1 56 package org.objectstyle.cayenne.modeler.dialog.db; 57 58 import java.awt.BorderLayout ; 59 60 import javax.swing.JPanel ; 61 import javax.swing.JScrollPane ; 62 import javax.swing.JTable ; 63 64 import com.jgoodies.forms.builder.PanelBuilder; 65 import com.jgoodies.forms.layout.CellConstraints; 66 import com.jgoodies.forms.layout.FormLayout; 67 68 71 public class TableSelectorView extends JPanel { 72 73 protected JTable tables; 74 75 public TableSelectorView() { 76 tables = new JTable (); 77 tables.setRowHeight(25); 78 tables.setRowMargin(3); 79 80 CellConstraints cc = new CellConstraints(); 81 PanelBuilder builder = new PanelBuilder(new FormLayout( 82 "fill:min(50dlu;pref):grow", 83 "p, 3dlu, fill:40dlu:grow")); 84 builder.setDefaultDialogBorder(); 85 builder.addSeparator("Select Tables", cc.xy(1, 1)); 86 builder.add(new JScrollPane ( 87 tables, 88 JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, 89 JScrollPane.HORIZONTAL_SCROLLBAR_NEVER), cc.xy(1, 3)); 90 91 setLayout(new BorderLayout ()); 92 add(builder.getPanel(), BorderLayout.CENTER); 93 } 94 95 public JTable getTables() { 96 return tables; 97 } 98 } | Popular Tags |