Java Code Examples for javax.swing.JTable#setFillsViewportHeight()
The following examples show how to use
javax.swing.JTable#setFillsViewportHeight() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClusteringReportWindow.java From mzmine2 with GNU General Public License v2.0 | 7 votes |
public ClusteringReportWindow(String[] samplesOrVariables, Integer[] clusteringData, String title) { super(title); String[] columnNames = {"Variables", "Cluster number"}; Object[][] data = new Object[samplesOrVariables.length][2]; for (int i = 0; i < samplesOrVariables.length; i++) { data[i][0] = samplesOrVariables[i]; data[i][1] = clusteringData[i]; } table = new JTable(data, columnNames); JScrollPane scrollPane = new JScrollPane(table); table.setFillsViewportHeight(true); this.add(scrollPane); pack(); }
Example 2
Source File: FilterPanel.java From dkpro-jwpl with Apache License 2.0 | 6 votes |
/** * Initialize JTable that contains namespaces */ private void initTable() { namespaces = new JTable(new FilterTableModel()); namespaces.removeColumn(namespaces.getColumn("#")); namespaces.setFillsViewportHeight(true); namespaces.setPreferredScrollableViewportSize(new Dimension(500, 70)); // Create the scroll pane and add the table to it. JScrollPane scrollPane = new JScrollPane(namespaces); scrollPane.setBounds(70, 10, 300, 200); this.add(scrollPane); }
Example 3
Source File: RspTabPanel.java From rest-client with Apache License 2.0 | 6 votes |
/** * * @Title: init * @Description: Component Initialization * @param name * @return void * @throws */ private void init(String name) { this.setLayout(new BorderLayout(RESTConst.BORDER_WIDTH, 0)); List<String> colNames = new ArrayList<String>(); colNames.add(name); colNames.add(RESTConst.VALUE); tabMdl = new TabModel(colNames); tab = new JTable(tabMdl); tab.setFillsViewportHeight(true); tab.setAutoCreateRowSorter(false); tab.getTableHeader().setReorderingAllowed(false); JPanel pnlNorth = new JPanel(); pnlNorth.setLayout(new FlowLayout(FlowLayout.CENTER)); this.add(pnlNorth, BorderLayout.NORTH); JPanel pnlCenter = new JPanel(); pnlCenter.setLayout(new GridLayout(1, 1)); JScrollPane sp = new JScrollPane(tab); pnlCenter.add(sp); this.add(pnlCenter, BorderLayout.CENTER); }
Example 4
Source File: MarkdownDocletOptionsForm.java From markdown-doclet with GNU General Public License v3.0 | 6 votes |
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL */ private void $$$setupUI$$$() { root = new JPanel(); root.setLayout(new GridLayoutManager(2, 4, new Insets(0, 0, 0, 0), -1, -1)); final JLabel label1 = new JLabel(); label1.setText("Project"); root.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); enableMarkdownDocletCheckBox = new JCheckBox(); enableMarkdownDocletCheckBox.setText("Enable Markdown Doclet"); root.add(enableMarkdownDocletCheckBox, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); optionsButton = new JButton(); optionsButton.setText("Options..."); root.add(optionsButton, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final Spacer spacer1 = new Spacer(); root.add(spacer1, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); final JScrollPane scrollPane1 = new JScrollPane(); root.add(scrollPane1, new GridConstraints(1, 0, 1, 4, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); modulesTable = new JTable(); modulesTable.setFillsViewportHeight(true); scrollPane1.setViewportView(modulesTable); }
Example 5
Source File: TableDemo.java From marathonv5 with Apache License 2.0 | 5 votes |
public TableDemo() { super(new GridLayout(1, 0)); JTable table = new JTable(new MyTableModel()); table.setPreferredScrollableViewportSize(new Dimension(500, 70)); table.setFillsViewportHeight(true); // Create the scroll pane and add the table to it. JScrollPane scrollPane = new JScrollPane(table); // Add the scroll pane to this panel. add(scrollPane); }
Example 6
Source File: ModifiedType.java From FastDMM with GNU General Public License v3.0 | 5 votes |
public boolean viewVariables(FastDMM editor) { final JDialog dialog = new JDialog(editor, "View Variables", true); final ModifiedTypeTableModel model = new ModifiedTypeTableModel(this); JTable table = new JTable(model); table.setFillsViewportHeight(true); table.setDefaultRenderer(Object.class, new ModifiedTypeRenderer(model)); dialog.getContentPane().add(new JScrollPane(table), BorderLayout.CENTER); JPanel bottomPanel = new JPanel(new BorderLayout()); dialog.getContentPane().add(bottomPanel, BorderLayout.SOUTH); JButton okButton = new JButton("OK"); okButton.addActionListener(e -> { model.doReturnTrue = true; dialog.setVisible(false); }); bottomPanel.add(okButton, BorderLayout.WEST); JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(e -> dialog.setVisible(false)); bottomPanel.add(cancelButton, BorderLayout.EAST); dialog.setLocationRelativeTo(editor); dialog.setSize(400, 450); dialog.setPreferredSize(dialog.getSize()); dialog.setVisible(true); return model.doReturnTrue; }
Example 7
Source File: CertificatesManagerSettingsPanel.java From Spark with Apache License 2.0 | 5 votes |
public void addCertTableToPanel() { certControll.loadKeyStores(); certControll.createTableModel(); certTable = new JTable(certControll.getTableModel()){ @Override public Component prepareRenderer(TableCellRenderer renderer, int rowIndex, int columnIndex) { JComponent component = (JComponent) super.prepareRenderer(renderer, rowIndex, columnIndex); Object value = getModel().getValueAt(convertRowIndexToModel(rowIndex), columnIndex); DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer(); centerRenderer.setHorizontalAlignment( JLabel.CENTER ); this.getColumnModel().getColumn(1).setCellRenderer(centerRenderer); if (value.equals(Res.getString("cert.valid"))) { component.setBackground(Color.green); } else if (value.equals(Res.getString("cert.expired")) || value .equals(Res.getString("cert.not.valid.yet")) || value.equals(Res.getString("cert.revoked"))) { component.setBackground(Color.red); } else { component.setBackground(Color.white); } return component; } }; scrollPane = new JScrollPane(certTable); certTable.setFillsViewportHeight(true); certTable.setAutoCreateRowSorter(true); certControll.resizeColumnWidth(certTable); certTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); }
Example 8
Source File: ImportForm.java From azure-devops-intellij with MIT License | 5 votes |
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL */ private void $$$setupUI$$$() { createUIComponents(); contentPanel = new JPanel(); contentPanel.setLayout(new GridLayoutManager(7, 3, new Insets(0, 0, 0, 0), -1, -1)); contentPanel.add(userAccountPanel, new GridConstraints(0, 0, 1, 3, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); final JLabel label1 = new JLabel(); this.$$$loadLabelText$$$(label1, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("ImportForm.SelectTeamProject")); contentPanel.add(label1, new GridConstraints(1, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); teamProjectFilter = new JTextField(); contentPanel.add(teamProjectFilter, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); teamProjectScrollPane = new JScrollPane(); contentPanel.add(teamProjectScrollPane, new GridConstraints(3, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); teamProjectTable = new JTable(); teamProjectTable.setFillsViewportHeight(true); teamProjectTable.setShowHorizontalLines(false); teamProjectTable.setShowVerticalLines(false); teamProjectScrollPane.setViewportView(teamProjectTable); final JLabel label2 = new JLabel(); this.$$$loadLabelText$$$(label2, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("ImportForm.NewRepositoryName")); contentPanel.add(label2, new GridConstraints(5, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); repositoryName = new JTextField(); contentPanel.add(repositoryName, new GridConstraints(6, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); refreshButton.setText(""); refreshButton.setToolTipText(ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("ImportDialog.RefreshButton.ToolTip")); contentPanel.add(refreshButton, new GridConstraints(2, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); busySpinner = new BusySpinnerPanel(); contentPanel.add(busySpinner, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); helpPanel = new HelpPanel(); helpPanel.setHelpText(ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("VsoLookupHelp.helpText")); helpPanel.setPopupText(ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("VsoLookupHelp.Instructions")); contentPanel.add(helpPanel, new GridConstraints(4, 0, 1, 3, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); }
Example 9
Source File: ListEmployees.java From JavaMainRepo with Apache License 2.0 | 5 votes |
public ListEmployees(String title, ArrayList<Employee> employees) { super(title); this.employees = employees; contentPanel.setLayout(new FlowLayout()); JPanel panel = new JPanel(); contentPanel.add(panel); JPanel pan = new JPanel(); contentPanel.add(pan); FlowLayout slPanel = new FlowLayout(); pan.setLayout(slPanel); String[] columns1 = { "Function", "Name", "ID", "Salary" }; String[][] info1 = new String[employees.size()][columns1.length]; int i1 = 0; for (Employee employee : employees) { info1[i1][0] = employee.getClass().getSimpleName(); info1[i1][1] = employee.getName(); info1[i1][2] = String.valueOf(employee.getId()); info1[i1][3] = String.valueOf(employee.getSalary()); i1++; } JTable table1 = new JTable(info1, columns1); table1.setPreferredScrollableViewportSize(new Dimension(500, 50)); table1.setFillsViewportHeight(true); JScrollPane scrollPane1 = new JScrollPane(table1); add(scrollPane1); JPanel panel_2 = new JPanel(); contentPanel.add(panel_2); setVisible(true); }
Example 10
Source File: KseFrame.java From keystore-explorer with GNU General Public License v3.0 | 5 votes |
private JScrollPane wrapKeyStoreTableInScrollPane(JTable jtKeyStore) { jtKeyStore.setOpaque(true); jtKeyStore.setShowGrid(false); jtKeyStore.setFillsViewportHeight(true); JScrollPane jspKeyStoreTable = PlatformUtil.createScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jspKeyStoreTable.setViewportView(jtKeyStore); jspKeyStoreTable.setBorder(BorderFactory.createEtchedBorder()); jspKeyStoreTable.setFocusable(false); return jspKeyStoreTable; }
Example 11
Source File: SimpleTableDemo.java From marathonv5 with Apache License 2.0 | 5 votes |
public SimpleTableDemo() { super(new GridLayout(1, 0)); String[] columnNames = { "First Name", "Last Name", "Sport", "# of Years", "Vegetarian" }; Object[][] data = { { "Kathy", "Smith", "Snowboarding", new Integer(5), new Boolean(false) }, { "John", "Doe", "Rowing", new Integer(3), new Boolean(true) }, { "Sue", "Black", "Knitting", new Integer(2), new Boolean(false) }, { "Jane", "White", "Speed reading", new Integer(20), new Boolean(true) }, { "Joe", "Brown", "Pool", new Integer(10), new Boolean(false) } }; final JTable table = new JTable(data, columnNames); table.setPreferredScrollableViewportSize(new Dimension(500, 70)); table.setFillsViewportHeight(true); if (DEBUG) { table.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { printDebugData(table); } }); } // Create the scroll pane and add the table to it. JScrollPane scrollPane = new JScrollPane(table); // Add the scroll pane to this panel. add(scrollPane); }
Example 12
Source File: ListAnimals.java From JavaMainRepo with Apache License 2.0 | 5 votes |
public ListAnimals(String title, ArrayList<Animal> animals) { super(title); this.animals = animals; contentPanel.setLayout(new FlowLayout()); JPanel panel = new JPanel(); contentPanel.add(panel); JPanel pan = new JPanel(); contentPanel.add(pan); FlowLayout slPanel = new FlowLayout(); pan.setLayout(slPanel); String[] columns = { "Species", "Name", "NrOfLegs", "MaintenanceCost", "DangerPercent" }; String[][] info = new String[animals.size()][columns.length]; int i = 0; for (Animal animal : animals) { info[i][0] = animal.getClass().getSimpleName(); info[i][1] = animal.getName(); info[i][2] = String.valueOf(animal.getNrOfLegs()); info[i][3] = String.valueOf(animal.getMaintenanceCost()); info[i][4] = String.valueOf(animal.getDangerPerc()); i++; } JTable table = new JTable(info, columns); table.setPreferredScrollableViewportSize(new Dimension(500, 50)); table.setFillsViewportHeight(true); JScrollPane scrollPane = new JScrollPane(table); add(scrollPane); JPanel panel_2 = new JPanel(); contentPanel.add(panel_2); setVisible(true); }
Example 13
Source File: ListEmployees.java From JavaMainRepo with Apache License 2.0 | 5 votes |
public ListEmployees(String title, ArrayList<Employee> employees) { super(title); this.employees = employees; contentPanel.setLayout(new FlowLayout()); JPanel panel = new JPanel(); contentPanel.add(panel); JPanel pan = new JPanel(); contentPanel.add(pan); FlowLayout slPanel = new FlowLayout(); pan.setLayout(slPanel); String[] columns1 = { "Function", "Name", "ID", "Salary" }; String[][] info1 = new String[employees.size()][columns1.length]; int i1 = 0; for (Employee employee : employees) { info1[i1][0] = employee.getClass().getSimpleName(); info1[i1][1] = employee.getName(); info1[i1][2] = String.valueOf(employee.getId()); info1[i1][3] = String.valueOf(employee.getSalary()); i1++; } JTable table1 = new JTable(info1, columns1); table1.setPreferredScrollableViewportSize(new Dimension(500, 50)); table1.setFillsViewportHeight(true); JScrollPane scrollPane1 = new JScrollPane(table1); add(scrollPane1); JPanel panel_2 = new JPanel(); contentPanel.add(panel_2); setVisible(true); }
Example 14
Source File: JDialogPlugins.java From freeinternals with Apache License 2.0 | 5 votes |
private void initComponents() { this.setLayout(new BorderLayout()); final JButton buttonClose = new JButton("Close"); buttonClose.addActionListener((final ActionEvent e) -> { buttonOK_Clicked(); }); // Lay out the labels from top to bottom. final JTable table = new JTable(new PluginsModel()); this.resizeColumnWidth(table); table.setPreferredScrollableViewportSize(table.getPreferredSize()); table.setFillsViewportHeight(true); JScrollPane scrollPane = new JScrollPane(table); final JPanel treePane = new JPanel(); treePane.setLayout(new BorderLayout()); treePane.add(scrollPane, BorderLayout.CENTER); treePane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); // Lay out the buttons from left to right. final JPanel buttonPane = new JPanel(); buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS)); buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); buttonPane.add(Box.createHorizontalGlue()); buttonPane.add(buttonClose); // Put everything together, using the content pane's BorderLayout. final Container contentPane = this.getContentPane(); contentPane.add(treePane, BorderLayout.CENTER); contentPane.add(buttonPane, BorderLayout.PAGE_END); }
Example 15
Source File: HistView.java From rest-client with Apache License 2.0 | 4 votes |
/** * * @Title: init * @Description: Component Initialization * @param name * @return void * @throws */ private void init() { this.setLayout(new BorderLayout(RESTConst.BORDER_WIDTH, RESTConst.BORDER_WIDTH)); this.setBorder(BorderFactory.createEmptyBorder(RESTConst.BORDER_WIDTH, RESTConst.BORDER_WIDTH, RESTConst.BORDER_WIDTH, RESTConst.BORDER_WIDTH)); List<String> colNames = new ArrayList<String>(); colNames.add(RESTConst.ID); colNames.add(RESTConst.REQUEST); colNames.add(RESTConst.RESPONSE); colNames.add(RESTConst.DATE); colNames.add(RESTConst.TIME); colNames.add(RESTConst.DESCR); tabMdl = new TabModel(colNames); tabMdl.setCellEditable(false); tab = new JTable(tabMdl); tab.setFillsViewportHeight(true); tab.setAutoCreateRowSorter(false); tab.getTableHeader().setReorderingAllowed(false); tab.addMouseListener(ma); tab.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); tab.getSelectionModel().addListSelectionListener(this); UIUtil.setHistTabWidth(tab); miRmSel = new JMenuItem(RESTConst.RM_SEL); miRmSel.setName(RESTConst.RM_SEL); miRmSel.addActionListener(this); miRmAll = new JMenuItem(RESTConst.RM_ALL); miRmAll.setName(RESTConst.RM_ALL); miRmAll.addActionListener(this); miMvUp = new JMenuItem(RESTConst.MOVE_UP); miMvUp.setName(RESTConst.MOVE_UP); miMvUp.addActionListener(this); miMvDown = new JMenuItem(RESTConst.MOVE_DOWN); miMvDown.setName(RESTConst.MOVE_DOWN); miMvDown.addActionListener(this); miEdit = new JMenuItem(RESTConst.EDIT); miEdit.setName(RESTConst.EDIT); miEdit.addActionListener(this); miRefresh = new JMenuItem(RESTConst.REFRESH); miRefresh.setName(RESTConst.REFRESH); miRefresh.addActionListener(this); histFrame = new HistFrame(); pm = new JPopupMenu(); pm.add(miRefresh); pm.add(miEdit); pm.addSeparator(); pm.add(miMvUp); pm.add(miMvDown); pm.addSeparator(); pm.add(miRmSel); pm.add(miRmAll); JPanel pnlCenter = new JPanel(); pnlCenter.setLayout(new GridLayout(1, 1)); JScrollPane sp = new JScrollPane(tab); pnlCenter.add(sp); this.add(pnlCenter, BorderLayout.CENTER); this.setBorder(BorderFactory.createTitledBorder(null, RESTConst.HTTP_HISTORY, TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION)); }
Example 16
Source File: CheckoutForm.java From azure-devops-intellij with MIT License | 4 votes |
/** * Method generated by IntelliJ IDEA GUI Designer * >>> IMPORTANT!! <<< * DO NOT edit this method OR call it in your code! * * @noinspection ALL */ private void $$$setupUI$$$() { createUIComponents(); contentPanel = new JPanel(); contentPanel.setLayout(new GridLayoutManager(10, 3, new Insets(0, 0, 0, 0), -1, -1)); contentPanel.setName(""); final JLabel label1 = new JLabel(); this.$$$loadLabelText$$$(label1, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("VsoCheckoutForm.SelectRepository")); contentPanel.add(label1, new GridConstraints(1, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); repositoryFilter = new JTextField(); repositoryFilter.setName(""); contentPanel.add(repositoryFilter, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); final JLabel label2 = new JLabel(); this.$$$loadLabelText$$$(label2, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("VsoCheckoutForm.ParentDirectory")); contentPanel.add(label2, new GridConstraints(5, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JLabel label3 = new JLabel(); this.$$$loadLabelText$$$(label3, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("VsoCheckoutForm.DirectoryName")); contentPanel.add(label3, new GridConstraints(7, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); directoryName = new JTextField(); directoryName.setName(""); contentPanel.add(directoryName, new GridConstraints(8, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); contentPanel.add(userAccountPanel, new GridConstraints(0, 0, 1, 3, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); repositoryTableScrollPane = new JScrollPane(); contentPanel.add(repositoryTableScrollPane, new GridConstraints(3, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); repositoryTable = new JTable(); repositoryTable.setFillsViewportHeight(true); repositoryTable.setName(""); repositoryTable.setShowHorizontalLines(false); repositoryTable.setShowVerticalLines(false); repositoryTableScrollPane.setViewportView(repositoryTable); parentDirectory = new TextFieldWithBrowseButton(); contentPanel.add(parentDirectory, new GridConstraints(6, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); helpPanel = new HelpPanel(); helpPanel.setHelpText(ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("VsoLookupHelp.helpText")); helpPanel.setPopupText(ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("VsoLookupHelp.Instructions")); contentPanel.add(helpPanel, new GridConstraints(4, 0, 1, 3, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); advancedCheckBox = new JCheckBox(); advancedCheckBox.setText("example text"); contentPanel.add(advancedCheckBox, new GridConstraints(9, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); busySpinner = new BusySpinnerPanel(); contentPanel.add(busySpinner, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); refreshButton.setToolTipText(ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("CheckoutDialog.RefreshButton.ToolTip")); contentPanel.add(refreshButton, new GridConstraints(2, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, 1, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); }
Example 17
Source File: Main_CustomersFrame.java From Hotel-Properties-Management-System with GNU General Public License v2.0 | 4 votes |
public Main_CustomersFrame() { this.setAutoscrolls(true); this.setMinimumSize(new Dimension(800, 600)); /*make it default size of frame maximized */ this.setMaximumSize(new Dimension(1000, 900)); this.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null)); setLayout(new BorderLayout(0, 0)); bean = LocaleBean.getInstance(); loggingEngine = LoggingEngine.getInstance(); componentOrientation = new ChangeComponentOrientation(); componentOrientation.setThePanel(this); searchPanel.setDoubleBuffered(false); searchPanel.setAutoscrolls(true); add(searchPanel, BorderLayout.NORTH); searchPanel.setPreferredSize(new Dimension(10, 30)); lblTableFilter = new JLabel("Type to search : "); lblTableFilter.setForeground(new Color(178, 34, 34)); lblTableFilter.setSize(new Dimension(130, 25)); lblTableFilter.setPreferredSize(new Dimension(130, 22)); lblTableFilter.setHorizontalTextPosition(SwingConstants.CENTER); lblTableFilter.setAutoscrolls(true); lblTableFilter.setHorizontalAlignment(SwingConstants.LEFT); lblTableFilter.setFont(new Font("Dialog", Font.BOLD, 15)); searchFilterField = new JTextField(); searchFilterField.setDragEnabled(true); searchFilterField.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, new Color(0, 191, 255), null, null, null)); searchFilterField.setPreferredSize(new Dimension(200, 22)); searchFilterField.setIgnoreRepaint(true); searchFilterField.setColumns(10); searchFilterField.setFont(new Font("Dialog", Font.BOLD, 13)); searchFilterField.setHorizontalAlignment(SwingConstants.LEFT); GroupLayout gl_searchPanel = new GroupLayout(searchPanel); gl_searchPanel.setHorizontalGroup( gl_searchPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_searchPanel.createSequentialGroup() .addContainerGap() .addComponent(lblTableFilter, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(searchFilterField, GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE) .addGap(118)) ); gl_searchPanel.setVerticalGroup( gl_searchPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_searchPanel.createSequentialGroup() .addGap(5) .addGroup(gl_searchPanel.createParallelGroup(Alignment.BASELINE) .addComponent(lblTableFilter, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(searchFilterField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); searchPanel.setLayout(gl_searchPanel); searchFilterField.addKeyListener(new KeyAdapter() { @Override public void keyTyped(KeyEvent e) { final String searchedWord = searchFilterField.getText(); filter(searchedWord); } }); scrollPane = new JScrollPane(); add(scrollPane); //populate main table model with custom method populateMainTable(model); customerTable = new JTable(model); customerTable.setFillsViewportHeight(true); customerTable.setRowSelectionAllowed(true); THR.setHorizontalAlignment(SwingConstants.CENTER); customerTable.setDefaultRenderer(Object.class, renderer); customerTable.getTableHeader().setDefaultRenderer(THR); customerTable.setFont(new Font("Dialog", Font.PLAIN, 14)); customerTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); customerTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); customerTable.setBackground(new Color(245, 245, 245)); customerTable.addMouseListener(openCustomerListener()); scrollPane.setViewportView(customerTable); //change component orientation with locale. if (bean.getLocale().toString().equals("ar_IQ")) { componentOrientation.changeOrientationOfJPanelToRight(); } else { componentOrientation.changeOrientationOfJPanelToLeft(); } //inject action event to Customers detail window to save all changes custWindow.setActionListener(saveChanges()); this.setVisible(true); }
Example 18
Source File: MutualAuthenticationSettingsPanel.java From Spark with Apache License 2.0 | 4 votes |
public MutualAuthenticationSettingsPanel(LocalPreferences localPreferences, JDialog optionsDialog) { setLayout(new GridBagLayout()); idControll = new IdentityController(localPreferences); idTable = new JTable(idControll.getTableModel()); idTable.addMouseListener(this); idTable.setPreferredSize(new Dimension(50, 50)); idTable.setPreferredScrollableViewportSize(idTable.getPreferredSize()); idTable.setFillsViewportHeight(true); scrollPane = new JScrollPane(idTable); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); ResourceUtils.resButton(addCertButton, Res.getString("label.choose.file")); ResourceUtils.resButton(selfSignedCertificate, Res.getString("cert.self.signed")); ResourceUtils.resButton(certificateSigningRequest, Res.getString("cert.sign.request")); ResourceUtils.resButton(saveCertToFile, Res.getString("cert.self.signed.save.to.file")); ResourceUtils.resLabel( commonNameLabel, commonNameField, Res.getString("cert.common.name")); ResourceUtils.resLabel( organizationUnitLabel, organizationUnitField, Res.getString("cert.organization.unit")); ResourceUtils.resLabel( organizationLabel, organizationField, Res.getString("cert.organization")); ResourceUtils.resLabel( countryLabel, countryField, Res.getString("cert.country")); ResourceUtils.resLabel( cityLabel, cityField, Res.getString("cert.city")); ResourceUtils.resButton(createButton, Res.getString("create")); ResourceUtils.resButton(showCert, Res.getString("button.show.certificate")); uploadCertificatePanel.setLayout(new GridBagLayout()); uploadCertificatePanel.setBorder(BorderFactory.createTitledBorder(Res.getString("label.certificate.add.certificate.to.identitystore"))); uploadCertificatePanel.add(addCertButton, new GridBagConstraints(0, 0, 1, 1, 0.05, 0.0, WEST, HORIZONTAL, DEFAULT_INSETS, 0, 0)); radioGroup.add(selfSignedCertificate); radioGroup.add(certificateSigningRequest); selfSignedCertificate.addActionListener(this); certificateSigningRequest.addActionListener(this); certificateSigningRequest.setSelected(true); saveCertToFile.setEnabled(false); creationPanel.setLayout(new GridBagLayout()); creationPanel.add(certificateSigningRequest, new GridBagConstraints(0, 0, 1, 1, 0.3, 1.0, WEST, HORIZONTAL, DEFAULT_INSETS, 0, 0)); creationPanel.add(selfSignedCertificate, new GridBagConstraints(1, 0, 1, 1, 0.3, 1.0, WEST, HORIZONTAL, DEFAULT_INSETS, 0, 0)); creationPanel.add(saveCertToFile, new GridBagConstraints(2, 0, 1, 1, 0.4, 1.0, WEST, HORIZONTAL, DEFAULT_INSETS, 200, 0)); creationPanel.add(commonNameLabel, new GridBagConstraints(0, 1, 1, 1, 0.05, 0.0, WEST, HORIZONTAL, DEFAULT_INSETS, 0, 0)); creationPanel.add(organizationUnitLabel, new GridBagConstraints(0, 2, 1, 1, 0.05, 0.0, WEST, HORIZONTAL, DEFAULT_INSETS, 0, 0)); creationPanel.add(organizationLabel, new GridBagConstraints(0, 3, 1, 1, 0.05, 0.0, WEST, HORIZONTAL, DEFAULT_INSETS, 0, 0)); creationPanel.add(countryLabel, new GridBagConstraints(0, 4, 1, 1, 0.05, 0.0, WEST, HORIZONTAL, DEFAULT_INSETS, 0, 0)); creationPanel.add(cityLabel, new GridBagConstraints(0, 5, 1, 1, 0.05, 0.0, WEST, HORIZONTAL, DEFAULT_INSETS, 0, 0)); creationPanel.add(createButton, new GridBagConstraints(0, 6, 1, 1, 0.05, 0.0, WEST, HORIZONTAL, DEFAULT_INSETS, 0, 0)); creationPanel.add(commonNameField, new GridBagConstraints(1, 1, 2, 1, 0.95, 1.0, WEST, HORIZONTAL, DEFAULT_INSETS, 0, 0)); creationPanel.add(organizationUnitField, new GridBagConstraints(1, 2, 2, 1, 0.95, 1.0, WEST, HORIZONTAL, DEFAULT_INSETS, 0, 0)); creationPanel.add(organizationField, new GridBagConstraints(1, 3, 2, 1, 0.95, 1.0, WEST, HORIZONTAL, DEFAULT_INSETS, 0, 0)); creationPanel.add(countryField, new GridBagConstraints(1, 4, 2, 1, 0.95, 1.0, WEST, HORIZONTAL, DEFAULT_INSETS, 0, 0)); creationPanel.add(cityField, new GridBagConstraints(1, 5, 2, 1, 0.95, 1.0, WEST, HORIZONTAL, DEFAULT_INSETS, 0, 0)); add(scrollPane, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.3, WEST, GridBagConstraints.BOTH, DEFAULT_INSETS, 0, 0)); add(uploadCertificatePanel, new GridBagConstraints(0, 1, 1, 1, 0.2, 0.2, WEST, GridBagConstraints.BOTH, new Insets(5, 5, 5, 400), 0, 0)); add(showCert, new GridBagConstraints(0, 2, 1, 1, 0.2, 0.2, WEST, HORIZONTAL, new Insets(5, 5, 5, 400), 0, 0)); add(creationPanel, new GridBagConstraints(0, 3, 1, 6, 1.0, 0.5, WEST, GridBagConstraints.BOTH, DEFAULT_INSETS, 0, 0)); showCert.setEnabled(false); showCert.addActionListener(this); addCertButton.addActionListener(this); createButton.addActionListener(this); }
Example 19
Source File: DisplayTableModule.java From FoxTelem with GNU General Public License v3.0 | 4 votes |
/** * Create a new module and set the title. Initialize the name and value arrays. * Create the GUI * * @param title * @param size */ public DisplayTableModule(FoxSpacecraft sat, String title, int size, int modType) { fox = sat; this.size = size; this.title = title; TitledBorder border = new TitledBorder(null, title, TitledBorder.LEADING, TitledBorder.TOP, null, null); moduleType = modType; if (moduleType >= DISPLAY_VULCAN) { border.setTitleFont(new Font("SansSerif", Font.BOLD, 10)); border.setTitleColor(vulcanFontColor); } else { border.setTitleFont(new Font("SansSerif", Font.BOLD, 12)); border.setTitleColor(Color.BLUE); // maxValue = new JLabel[size]; // minValue = new JLabel[size]; } this.setBorder(border); displayTableModel = new DisplayTableModel(); table = new JTable(displayTableModel); table.setFillsViewportHeight(true); table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN); table.setOpaque(false); add(new JScrollPane(table)); //add(table); TableColumn column = null; column = table.getColumnModel().getColumn(0); column.setPreferredWidth(130); column.setMinWidth(60); data = new String[size][4]; for (int i=1; i<4; i++) { column = table.getColumnModel().getColumn(i); //column.sizeWidthToFit(); column.setPreferredWidth(25); column.setMinWidth(25); } fieldName = new String[size]; // rtValue = new JLabel[size]; // label = new JLabel[size]; // row = new JPanel[size]; graph = new GraphFrame[size]; display = new int[size]; initGui(); }
Example 20
Source File: AccountsPanel.java From btdex with GNU General Public License v3.0 | 4 votes |
public AccountsPanel(Main main) { super(new BorderLayout()); this.main = main; table = new JTable(model = new DefaultTableModel(COLUMN_NAMES, 0)); for (int i = 0; i < COLUMN_NAMES.length; i++) { table.getColumnModel().getColumn(i).setHeaderValue(tr(COLUMN_NAMES[i])); } table.setRowHeight(table.getRowHeight()+7); table.setPreferredScrollableViewportSize(new Dimension(400, 200)); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.getSelectionModel().addListSelectionListener(this); left = new JPanel(new BorderLayout()); right = new JPanel(); right.setVisible(false); right.setLayout(new BoxLayout(right, BoxLayout.Y_AXIS)); left.setBorder(BorderFactory.createTitledBorder(tr("acc_your_accounts"))); right.setBorder(BorderFactory.createTitledBorder(tr("acc_account_details"))); JScrollPane scrollPane = new JScrollPane(table); table.setFillsViewportHeight(true); // Center header and all columns DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer(); centerRenderer.setHorizontalAlignment( JLabel.CENTER ); for (int i = 0; i < table.getColumnCount(); i++) { table.getColumnModel().getColumn(i).setCellRenderer( centerRenderer ); } JTableHeader jtableHeader = table.getTableHeader(); DefaultTableCellRenderer rend = (DefaultTableCellRenderer) table.getTableHeader().getDefaultRenderer(); rend.setHorizontalAlignment(JLabel.CENTER); jtableHeader.setDefaultRenderer(rend); table.setAutoCreateColumnsFromModel(false); table.getColumnModel().getColumn(COL_NAME).setPreferredWidth(200); table.getColumnModel().getColumn(COL_MARKET).setPreferredWidth(20); JPanel buttonPane = new JPanel(new FlowLayout(FlowLayout.RIGHT)); left.add(buttonPane, BorderLayout.PAGE_END); addButton = new JButton(tr("acc_add_button")); removeButton = new JButton(tr("acc_remove_button")); removeButton.setEnabled(false); addButton.addActionListener(this); removeButton.addActionListener(this); buttonPane.add(addButton); buttonPane.add(removeButton); marketComboBox = new JComboBox<Market>(); for(Market m : Markets.getMarkets()) { if(m.getTokenID()!=null) continue; marketComboBox.addItem(m); } marketComboBox.addActionListener(this); JPanel topPanel = new JPanel(new SpringLayout()); topPanel.add(new Desc(tr("main_market"), marketComboBox), BorderLayout.LINE_START); topPanel.add(new Desc(tr("acc_alias"), nameField = new JTextField()), BorderLayout.CENTER); SpringUtilities.makeCompactGrid(topPanel, 1, 2, 0, 0, PAD, PAD); right.add(topPanel); formPanel = new JPanel(new SpringLayout()); // JScrollPane formScroll = new JScrollPane(formPanel); // right.add(formScroll); right.add(formPanel); cancelButton = new JButton(tr("dlg_cancel")); okButton = new JButton(tr("dlg_ok")); cancelButton.addActionListener(this); okButton.addActionListener(this); rightButtonPane = new JPanel(new FlowLayout(FlowLayout.RIGHT)); rightButtonPane.add(cancelButton); rightButtonPane.add(okButton); right.add(rightButtonPane); add(left, BorderLayout.LINE_START); JPanel rightContainer = new JPanel(new BorderLayout()); rightContainer.add(right, BorderLayout.PAGE_START); add(rightContainer, BorderLayout.CENTER); left.add(scrollPane, BorderLayout.CENTER); loadAccounts(); }