1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-23 04:22:05 +01:00

added Button to clear "All Packets" Tab

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@12152 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Wolf Posdorfer 2011-03-21 15:08:48 +00:00 committed by wolf.posdorfer
parent 2150d07435
commit 01a1fb7751

View file

@ -316,7 +316,27 @@ public class EnhancedDebugger implements SmackDebugger {
menu.add(menuItem1); menu.add(menuItem1);
// Add listener to the text area so the popup menu can come up. // Add listener to the text area so the popup menu can come up.
messageTextArea.addMouseListener(new PopupListener(menu)); messageTextArea.addMouseListener(new PopupListener(menu));
allPane.setBottomComponent(new JScrollPane(messageTextArea)); JPanel sublayout = new JPanel(new BorderLayout());
sublayout.add(new JScrollPane(messageTextArea), BorderLayout.CENTER);
JButton clearb = new JButton("Clear All Packets");
clearb.addActionListener(new AbstractAction() {
private static final long serialVersionUID = -8576045822764763613L;
@Override
public void actionPerformed(ActionEvent e) {
for(int i=0; i< messagesTable.getRowCount();i++)
{
messagesTable.removeRow(i);
}
}
});
sublayout.add(clearb, BorderLayout.NORTH);
allPane.setBottomComponent(sublayout);
allPane.setDividerLocation(150); allPane.setDividerLocation(150);
tabbedPane.add("All Packets", allPane); tabbedPane.add("All Packets", allPane);