JFrame frame = new JFrame("JListView test");
Container container = frame.getContentPane();
JTableAppender appender = new JTableAppender();
JTableAppenderModel model = new
JTableAppenderModel(Integer.parseInt(args[0]));
appender.setModel(model);
//appender.createDefaultColumnsFromModel();
JScrollPane sp = new JScrollPane(appender);
sp.setPreferredSize(new Dimension(250, 80));
container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS));
//container.add(view);
container.add(sp);
JButton button = new JButton("ADD");
container.add(button);
button.addActionListener(new JTableAddAction(appender));
frame.setVisible(true);
frame.setSize(new Dimension(700,700));
long before = System.currentTimeMillis();
int RUN = 10000;
int i = 0;
while(i++ < RUN) {
LoggingEvent event = new LoggingEvent("x", cat, Priority.ERROR,
"Message "+i, null);
event.getThreadName();
if(i % 10 == 0) {
//event.throwable = new Exception("hello "+i);
}
appender.add(event);
}
long after = System.currentTimeMillis();
System.out.println("Time taken :"+ ((after-before)*1000/RUN));