BorderFactory.createTitledBorder(" Categories "), BorderFactory
.createEmptyBorder(1, 1, 1, 1)));
categoriesPanel.setBounds(10, 20, 190, SIZE_Y - 70);
this.add(categoriesPanel);
catTableModel = new SingleColumnModel(" Category Name ");
categoriesTable = new JTable(catTableModel);
categoriesTable.setName(NAME_CATEGORY);
popup(categoriesTable);
categoriesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
catTableModel.setData(mWindow.getJBroFuzz().getDatabase()
.getAllCategories());
final TableRowSorter<SingleColumnModel> sorter =
new TableRowSorter<SingleColumnModel>(catTableModel);
categoriesTable.setRowSorter(sorter);
categoriesTable.setFont(new Font("Verdana", Font.BOLD, 10));
categoriesTable.setRowHeight(30);
categoriesTable.getSelectionModel().addListSelectionListener(
new CategoriesRowListener());
categoriesTable.setBackground(Color.BLACK);
categoriesTable.setForeground(Color.WHITE);
categoriesTable.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(final KeyEvent kEvent) {
if (kEvent.getKeyCode() == 27) {
PayloadsDialog.this.dispose();
}
}
});
final JScrollPane catScrollPane = new JScrollPane(
categoriesTable);
catScrollPane.setVerticalScrollBarPolicy(20);
catScrollPane.setHorizontalScrollBarPolicy(30);
catScrollPane.setPreferredSize(new Dimension(170, SIZE_Y - 110));
categoriesPanel.add(catScrollPane);
// Fuzzers : The middle area displaying the list of fuzzers by name
fuzzersPanel = new JPanel();
fuzzersPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory
.createTitledBorder(" Select a Category "), BorderFactory
.createEmptyBorder(1, 1, 1, 1)));
fuzzersPanel.setBounds(210, 20, 180, 250);
this.add(fuzzersPanel);
fTableModel = new SingleColumnModel(" Fuzzer Name ");
fuzzersTable = new JTable(fTableModel);
fuzzersTable.setName(NAME_FUZZER);
popup(fuzzersTable);
sorter2 = new TableRowSorter<SingleColumnModel>(fTableModel);
fuzzersTable.setRowSorter(sorter2);
fuzzersTable.setFont(new Font("Verdana", Font.BOLD, 10));
fuzzersTable.setRowHeight(30);
fuzzersTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
fuzzersTable.getSelectionModel().addListSelectionListener(
new FuzzersRowListener());
fuzzersTable.setBackground(Color.BLACK);
fuzzersTable.setForeground(Color.WHITE);
/*
* fuzzersTable.addMouseListener(new MouseAdapter(){ @Override public
* void mouseClicked(final MouseEvent e){ if (e.getClickCount() == 1){
* okBut.setEnabled(true); // String exploit = (String)
* nameTable.getModel().getValueAt(nameTable.getSelectedRow(), 0); //
* new ExploitViewer(mWindow, exploit, ExploitViewer.VIEW_EXPLOIT); } } } );
*/
fuzzersTable.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(final KeyEvent kEvent) {
if (kEvent.getKeyCode() == 27) {
PayloadsDialog.this.dispose();
}
}
});
final JScrollPane nameScrollPane = new JScrollPane(
fuzzersTable);
nameScrollPane.setVerticalScrollBarPolicy(20);
nameScrollPane.setHorizontalScrollBarPolicy(30);
nameScrollPane
.setPreferredSize(new Dimension(160, SIZE_Y - 190));
fuzzersPanel.add(nameScrollPane);
// Payloads : A JSplitPane with a table and a textArea
payloadsPanel = new JPanel();
payloadsPanel.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder(" Select a Fuzzer "),
BorderFactory.createEmptyBorder(1, 1, 1, 1)));
payloadsPanel.setBounds(400, 20, 260, 190);
payloadsPanel.setLayout(new BoxLayout(payloadsPanel, BoxLayout.Y_AXIS));
this.add(payloadsPanel);
pTableModel = new SingleColumnModel(" Payloads ");
payloadsTable = new JTable(pTableModel);
payloadsTable.setName(NAME_PAYLOAD);
popup(payloadsTable);
payloadsTable.setFont(new Font("Verdana", Font.BOLD, 10));