1 package org.enhydra.barracuda.testbed.workbench; 2 3 import java.awt.*; 4 import java.awt.event.*; 5 import java.util.*; 6 import javax.swing.*; 7 import javax.swing.event.*; 8 import javax.swing.plaf.*; 9 import javax.swing.plaf.metal.*; 10 11 import org.enhydra.barracuda.testbed.workbench.stress.URLStressTester; 12 import org.enhydra.barracuda.testbed.workbench.jdbc.JDBCTester; 13 14 28 public class WorkBench extends JPanel { 29 30 public static int showDebug = 2; 32 33 35 36 39 public WorkBench() { 40 try { 42 initViews(); 43 } catch (Exception be) { 44 System.out.println ("Error initializing "+this); 45 be.printStackTrace(); 46 } 47 } 48 49 55 private void initViews() throws Exception { 56 this.setLayout(new BorderLayout()); 58 59 JTabbedPane jtpTabs = new JTabbedPane(); 61 this.add(jtpTabs, BorderLayout.CENTER); 62 63 URLStressTester urlStressTester = new URLStressTester(); 65 jtpTabs.addTab("URL Stress Tester", null, urlStressTester, "Perform URL Stress Testing"); 66 67 JDBCTester jdbcTester = new JDBCTester(); 69 jtpTabs.addTab("JDBC Tester", null, jdbcTester, "Connect to a JDBC Datasource"); 70 71 } 74 75 76 public static void main(String [] args) { 77 JFrame frame = new JFrame(); 79 frame.addWindowListener(new WindowAdapter() { 80 public void windowClosing(java.awt.event.WindowEvent event) { 81 System.exit(0); } 83 }); 84 85 WorkBench masterView = new WorkBench(); 87 frame.getContentPane().add(masterView, BorderLayout.CENTER); 88 89 Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); 91 frame.setTitle("Barracuda Workbench"); 92 frame.setSize(new Dimension(800, 600)); 93 frame.setLocation((d.width-frame.getSize().width)/2, (d.height-frame.getSize().height)/2); 94 frame.setVisible(true); 95 } 96 97 100 static { 101 try { 102 UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); 104 UIDefaults uid = UIManager.getLookAndFeelDefaults(); 105 106 uid.put("CheckBox.foreground", uid.get("Label.foreground")); 108 uid.put("RadioButton.foreground", uid.get("Label.foreground")); 109 } catch (Exception e) {} 110 } 111 112 113 } 114 | Popular Tags |