/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package testmultisplitpanes; import java.awt.ComponentOrientation; import javax.swing.JInternalFrame; import javax.swing.JSplitPane; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; public class MultiSplit extends javax.swing.JFrame { /** * Creates new form MultiSplit */ public MultiSplit() { initComponents(); setLocationRelativeTo(null); } /** * 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() { jSplitPane1 = new javax.swing.JSplitPane(); GraphManagerPanel = new javax.swing.JPanel(); AddPanesButton = new javax.swing.JButton(); jButton1 = new javax.swing.JButton(); jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jMenuBar1 = new javax.swing.JMenuBar(); FileMenu = new javax.swing.JMenu(); EditMenu = new javax.swing.JMenu(); AtMenu = new javax.swing.JMenu(); IndicatorsMenuItem = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Test add Panels and TA Indicators"); jSplitPane1.setDividerLocation(130); GraphManagerPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Graph Manager")); AddPanesButton.setText("Add Split Panes"); jButton1.setText("Add Int Frames"); jButton1.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton1MousePressed(evt); } }); javax.swing.GroupLayout GraphManagerPanelLayout = new javax.swing.GroupLayout(GraphManagerPanel); GraphManagerPanel.setLayout(GraphManagerPanelLayout); GraphManagerPanelLayout.setHorizontalGroup( GraphManagerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(GraphManagerPanelLayout.createSequentialGroup() .addGroup(GraphManagerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(AddPanesButton, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE) .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); GraphManagerPanelLayout.setVerticalGroup( GraphManagerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(GraphManagerPanelLayout.createSequentialGroup() .addGap(88, 88, 88) .addComponent(jButton1) .addGap(112, 112, 112) .addComponent(AddPanesButton) .addContainerGap(241, Short.MAX_VALUE)) ); jSplitPane1.setLeftComponent(GraphManagerPanel); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 610, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 483, Short.MAX_VALUE) ); jTabbedPane1.addTab("tab1", jPanel1); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 610, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 483, Short.MAX_VALUE) ); jTabbedPane1.addTab("tab2", jPanel2); jSplitPane1.setRightComponent(jTabbedPane1); FileMenu.setText("File"); jMenuBar1.add(FileMenu); EditMenu.setText("Edit"); jMenuBar1.add(EditMenu); AtMenu.setText("Analysis Tools"); IndicatorsMenuItem.setText("Indicators"); IndicatorsMenuItem.addMouseListener(new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { IndicatorsMenuItemMousePressed(evt); } }); AtMenu.add(IndicatorsMenuItem); jMenuBar1.add(AtMenu); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jSplitPane1) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jSplitPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 513, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void IndicatorsMenuItemMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_IndicatorsMenuItemMousePressed AtDialog at = new AtDialog(this, true); at.setLocationRelativeTo(null); at.setVisible(true); }//GEN-LAST:event_IndicatorsMenuItemMousePressed private void jButton1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MousePressed JInternalFrame jif = new JInternalFrame(); JSplitPane jsp = new JSplitPane(); jsp.setSize(350, 200); int VERT = JSplitPane.VERTICAL_SPLIT; jsp.setOrientation(VERT); jsp.setVisible(true); jsp.setDividerLocation(100); jif.add(jsp); jPanel1.add(jif); jif.setSize(350, 200); jif.setResizable(true); jif.setClosable(true); jif.setMaximizable(true); jif.setIconifiable(true); jif.setVisible(true); }//GEN-LAST:event_jButton1MousePressed /** * @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 { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (UnsupportedLookAndFeelException e) { //handle exception } catch (ClassNotFoundException e) { //handle exception } catch (InstantiationException e) { //handle exception } catch (IllegalAccessException e) { //handle exception } //</editor-fold> /* * Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { new MultiSplit().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton AddPanesButton; private javax.swing.JMenu AtMenu; private javax.swing.JMenu EditMenu; private javax.swing.JMenu FileMenu; private javax.swing.JPanel GraphManagerPanel; private javax.swing.JMenuItem IndicatorsMenuItem; private javax.swing.JButton jButton1; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JSplitPane jSplitPane1; private javax.swing.JTabbedPane jTabbedPane1; // End of variables declaration//GEN-END:variables }