use of javax.swing.JTable in project binnavi by google.
the class CViewSearcherDialog method createGui.
/**
* Creates the GUI of the dialog.
*/
private void createGui() {
setLayout(new BorderLayout());
final JPanel panel = new JPanel(new BorderLayout());
final JLabel lbl = new JLabel("Address" + ":");
lbl.setBorder(new EmptyBorder(5, 5, 5, 5));
panel.add(lbl, BorderLayout.WEST);
m_offsetField.setSize(400, 20);
final ActionListener listener = new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
search();
}
};
m_offsetField.addActionListener(listener);
panel.add(m_offsetField, BorderLayout.CENTER);
panel.add(new JButton(CActionProxy.proxy(new SearchAction(this))), BorderLayout.EAST);
add(panel, BorderLayout.NORTH);
m_table = new JTable(tableModel);
m_table.addMouseListener(m_listener);
add(new JScrollPane(m_table), BorderLayout.CENTER);
add(new CPanelTwoButtons(CActionProxy.proxy(new InternalActionListener()), "OK", "Cancel"), BorderLayout.SOUTH);
setSize(500, 300);
}
use of javax.swing.JTable in project zaproxy by zaproxy.
the class PolicyManagerDialog method getParamsTable.
private JTable getParamsTable() {
if (paramsTable == null) {
paramsTable = new JTable();
paramsTable.setModel(getParamsModel());
paramsTable.addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent e) {
}
@Override
public void mousePressed(MouseEvent e) {
if (e.getClickCount() >= 2) {
int row = paramsTable.rowAtPoint(e.getPoint());
if (row >= 0) {
String name = (String) getParamsModel().getValueAt(row, 0);
if (name != null) {
try {
extension.showPolicyDialog(PolicyManagerDialog.this, name);
} catch (ConfigurationException e1) {
logger.error(e1.getMessage(), e1);
}
}
}
}
}
@Override
public void mouseReleased(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
}
@Override
public void mouseExited(MouseEvent e) {
}
});
paramsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
if (getParamsTable().getSelectedRowCount() == 0) {
getModifyButton().setEnabled(false);
getRemoveButton().setEnabled(false);
getExportButton().setEnabled(false);
} else if (getParamsTable().getSelectedRowCount() == 1) {
getModifyButton().setEnabled(true);
// Dont let the last policy be removed
getRemoveButton().setEnabled(getParamsModel().getRowCount() > 1);
getExportButton().setEnabled(true);
} else {
getModifyButton().setEnabled(false);
getRemoveButton().setEnabled(false);
getExportButton().setEnabled(false);
}
}
});
}
return paramsTable;
}
use of javax.swing.JTable in project zaproxy by zaproxy.
the class ScanProgressDialog method getMainPanel.
/**
* Get the main content panel of the dialog
* @return the main panel
*/
private JTable getMainPanel() {
if (table == null) {
model = new ScanProgressTableModel();
table = new JTable();
table.setModel(model);
table.setRowSelectionAllowed(false);
table.setColumnSelectionAllowed(false);
table.setDoubleBuffered(true);
// First column is for plugin's name
table.getColumnModel().getColumn(0).setPreferredWidth(256);
table.getColumnModel().getColumn(1).setPreferredWidth(80);
// Second column is for plugin's status
table.getColumnModel().getColumn(2).setPreferredWidth(80);
table.getColumnModel().getColumn(2).setCellRenderer(new ScanProgressBarRenderer());
// Third column is for plugin's elapsed time
DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer();
centerRenderer.setHorizontalAlignment(JLabel.CENTER);
table.getColumnModel().getColumn(3).setPreferredWidth(85);
table.getColumnModel().getColumn(3).setCellRenderer(centerRenderer);
// Forth column is for plugin's request count
DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer();
rightRenderer.setHorizontalAlignment(JLabel.RIGHT);
table.getColumnModel().getColumn(4).setPreferredWidth(60);
table.getColumnModel().getColumn(4).setCellRenderer(rightRenderer);
// Fifth column is for plugin's completion and actions
table.getColumnModel().getColumn(5).setPreferredWidth(40);
table.getColumnModel().getColumn(5).setCellRenderer(new ScanProgressActionRenderer());
ScanProgressActionListener listener = new ScanProgressActionListener(table, model);
table.addMouseListener(listener);
table.addMouseMotionListener(listener);
}
return table;
}
use of javax.swing.JTable in project nhin-d by DirectProject.
the class PKCS11SecretKeyManager method initUI.
private void initUI() {
this.getContentPane().setLayout(new BorderLayout(5, 5));
// Top Panel
JPanel topPanel = new JPanel();
topPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
addAESKeyButton = new JButton("Add AES Key");
addAESKeyButton.setSize(new Dimension(30, 100));
addGenericKeyButton = new JButton("Add Text Key");
addGenericKeyButton.setSize(new Dimension(30, 100));
removeKeyButton = new JButton("Remove Key(s)");
removeKeyButton.setSize(new Dimension(30, 100));
topPanel.add(addAESKeyButton);
topPanel.add(addGenericKeyButton);
topPanel.add(removeKeyButton);
this.getContentPane().add(topPanel, BorderLayout.NORTH);
// Middle and list panel
JPanel midPanel = new JPanel();
midPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
midPanel.setLayout(new BorderLayout(5, 5));
JLabel keyListLabel = new JLabel("Secret Keys:");
Object[][] data = {};
String[] columnNames = { "Key Alias", "Key Type", "Key Value" };
keyDataModel = new DefaultTableModel(data, columnNames);
keyDataTable = new JTable(keyDataModel);
JScrollPane scrollPane = new JScrollPane(keyDataTable);
keyDataTable.setFillsViewportHeight(true);
midPanel.add(keyListLabel, BorderLayout.NORTH);
midPanel.add(scrollPane, BorderLayout.CENTER);
this.getContentPane().add(midPanel, BorderLayout.CENTER);
// Bottom Panel
JPanel bottomPanel = new JPanel();
bottomPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
quitButton = new JButton("Quit");
quitButton.setSize(new Dimension(30, 100));
bottomPanel.add(quitButton);
this.getContentPane().add(bottomPanel, BorderLayout.SOUTH);
}
use of javax.swing.JTable in project nhin-d by DirectProject.
the class PKCS11SecretKeyManagerUI method initUI.
private void initUI() {
this.getContentPane().setLayout(new BorderLayout(5, 5));
// Top Panel
JPanel topPanel = new JPanel();
topPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
addAESKeyButton = new JButton("Add AES Key");
addAESKeyButton.setSize(new Dimension(30, 100));
addGenericKeyButton = new JButton("Add Text Key");
addGenericKeyButton.setSize(new Dimension(30, 100));
removeKeyButton = new JButton("Remove Key(s)");
removeKeyButton.setSize(new Dimension(30, 100));
topPanel.add(addAESKeyButton);
topPanel.add(addGenericKeyButton);
topPanel.add(removeKeyButton);
this.getContentPane().add(topPanel, BorderLayout.NORTH);
// Middle and list panel
JPanel midPanel = new JPanel();
midPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
midPanel.setLayout(new BorderLayout(5, 5));
JLabel keyListLabel = new JLabel("Secret Keys:");
Object[][] data = {};
String[] columnNames = { "Key Alias", "Key Type", "Key Value" };
keyDataModel = new DefaultTableModel(data, columnNames);
keyDataTable = new JTable(keyDataModel);
JScrollPane scrollPane = new JScrollPane(keyDataTable);
keyDataTable.setFillsViewportHeight(true);
midPanel.add(keyListLabel, BorderLayout.NORTH);
midPanel.add(scrollPane, BorderLayout.CENTER);
this.getContentPane().add(midPanel, BorderLayout.CENTER);
// Bottom Panel
JPanel bottomPanel = new JPanel();
bottomPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
quitButton = new JButton("Quit");
quitButton.setSize(new Dimension(30, 100));
bottomPanel.add(quitButton);
this.getContentPane().add(bottomPanel, BorderLayout.SOUTH);
}
Aggregations