OpenSeSim/src/Gui/MainWin.java

142 lines
5.2 KiB
Java

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Gui;
import SeSim.Exchange;
/**
*
* @author 7u83 <7u83@mail.ru>
*/
public class MainWin extends javax.swing.JFrame {
/**
* Creates new form MainWin
*/
public MainWin() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jList1 = new javax.swing.JList<>();
jButton1 = new javax.swing.JButton();
orderBook1 = new Gui.OrderBook();
orderBook = new Gui.OrderBook();
MainMenu = new javax.swing.JMenuBar();
FileMenu = new javax.swing.JMenu();
FileNew = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jList1.setModel(new javax.swing.AbstractListModel<String>() {
String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
public int getSize() { return strings.length; }
public String getElementAt(int i) { return strings[i]; }
});
jScrollPane1.setViewportView(jList1);
jButton1.setText("jButton1");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setMinimumSize(new java.awt.Dimension(400, 200));
getContentPane().setLayout(new java.awt.GridLayout());
getContentPane().add(orderBook);
FileMenu.setText("File");
FileNew.setText("New");
FileNew.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
FileNewActionPerformed(evt);
}
});
FileMenu.add(FileNew);
MainMenu.add(FileMenu);
jMenu2.setText("Edit");
MainMenu.add(jMenu2);
setJMenuBar(MainMenu);
pack();
}// </editor-fold>//GEN-END:initComponents
private void FileNewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_FileNewActionPerformed
System.out.print("Menu 0 called\n");
}//GEN-LAST:event_FileNewActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jButton1ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(MainWin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MainWin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MainWin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MainWin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
SeSim.Exchange se = new Exchange();
se.start();
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MainWin().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JMenu FileMenu;
private javax.swing.JMenuItem FileNew;
private javax.swing.JMenuBar MainMenu;
private javax.swing.JButton jButton1;
private javax.swing.JList<String> jList1;
private javax.swing.JMenu jMenu2;
private javax.swing.JScrollPane jScrollPane1;
private Gui.OrderBook orderBook;
private Gui.OrderBook orderBook1;
// End of variables declaration//GEN-END:variables
}