List of usage examples for javax.swing WindowConstants DISPOSE_ON_CLOSE
int DISPOSE_ON_CLOSE
To view the source code for javax.swing WindowConstants DISPOSE_ON_CLOSE.
Click Source Link
From source file:graph.plotter.PieMenu.java
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { buttonGroup1 = new javax.swing.ButtonGroup(); jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jRadioButton1 = new javax.swing.JRadioButton(); jTextField2 = new javax.swing.JTextField(); jTextField1 = new javax.swing.JTextField(); jScrollPane1 = new javax.swing.JScrollPane(); Table = new javax.swing.JTable(); jRadioButton2 = new javax.swing.JRadioButton(); jTextField3 = new javax.swing.JTextField(); jButton3 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); jLabel4 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setResizable(false);/*from ww w . j av a 2s .c o m*/ setSize(new java.awt.Dimension(800, 650)); jPanel1.setBackground(new java.awt.Color(255, 255, 255)); jPanel1.setPreferredSize(new java.awt.Dimension(800, 650)); jPanel1.setLayout(null); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graph/plotter/4.jpg"))); // NOI18N jPanel1.add(jLabel1); jLabel1.setBounds(0, 0, 470, 470); jLabel2.setText("Name"); jPanel1.add(jLabel2); jLabel2.setBounds(510, 40, 60, 20); jLabel3.setText("Amount"); jPanel1.add(jLabel3); jLabel3.setBounds(700, 40, 60, 20); jButton1.setText("Show in Pie Chart"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jPanel1.add(jButton1); jButton1.setBounds(540, 420, 150, 60); jButton2.setText("Back"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jPanel1.add(jButton2); jButton2.setBounds(730, 430, 80, 40); buttonGroup1.add(jRadioButton1); jRadioButton1.setText("User Input"); jRadioButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton1ActionPerformed(evt); } }); jPanel1.add(jRadioButton1); jRadioButton1.setBounds(480, 10, 110, 23); jTextField2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField2ActionPerformed(evt); } }); jPanel1.add(jTextField2); jTextField2.setBounds(690, 70, 120, 30); jPanel1.add(jTextField1); jTextField1.setBounds(500, 70, 160, 30); Table.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { }, new String[] { "Name", "Amount" })); Table.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { TableMouseClicked(evt); } }); jScrollPane1.setViewportView(Table); jPanel1.add(jScrollPane1); jScrollPane1.setBounds(500, 200, 310, 110); buttonGroup1.add(jRadioButton2); jRadioButton2.setText("Attach .csv File"); jRadioButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton2ActionPerformed(evt); } }); jPanel1.add(jRadioButton2); jRadioButton2.setBounds(480, 320, 170, 23); jTextField3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField3ActionPerformed(evt); } }); jPanel1.add(jTextField3); jTextField3.setBounds(520, 350, 190, 40); jButton3.setText("Import"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jPanel1.add(jButton3); jButton3.setBounds(740, 350, 70, 30); jButton4.setText("Add"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); jPanel1.add(jButton4); jButton4.setBounds(510, 110, 80, 30); jButton5.setText("Delete"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jPanel1.add(jButton5); jButton5.setBounds(510, 150, 80, 30); jLabel4.setText("[Blank Input is not Allowed!]"); jPanel1.add(jLabel4); jLabel4.setBounds(620, 120, 170, 20); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 838, javax.swing.GroupLayout.PREFERRED_SIZE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE)); pack(); }
From source file:ventanas.intervalosLenguaje.java
/** * 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.//from w w w . j a va 2s.c o m */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { cantidadIntervalos = new javax.swing.ButtonGroup(); jScrollPane2 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); cantidadNumeros = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jRadioButton1 = new javax.swing.JRadioButton(); jRadioButton2 = new javax.swing.JRadioButton(); jRadioButton3 = new javax.swing.JRadioButton(); jScrollPane1 = new javax.swing.JScrollPane(); tabla = new javax.swing.JTable(); jButton1 = new javax.swing.JButton(); button_graficar = new javax.swing.JButton(); jScrollPane3 = new javax.swing.JScrollPane(); tabla2 = new javax.swing.JTable(); jTable1.setModel( new javax.swing.table.DefaultTableModel( new Object[][] { { null, null, null, null }, { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); jScrollPane2.setViewportView(jTable1); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Simulacin"); cantidadNumeros.setName("cantidadNumeros"); // NOI18N jLabel1.setText("Cantidad de numeros"); jLabel2.setText("Cantidad de intervalos"); cantidadIntervalos.add(jRadioButton1); jRadioButton1.setText("5"); cantidadIntervalos.add(jRadioButton2); jRadioButton2.setText("10"); cantidadIntervalos.add(jRadioButton3); jRadioButton3.setText("20"); tabla.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { }, new String[] { })); jScrollPane1.setViewportView(tabla); jButton1.setText("Generar numeros"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); button_graficar.setText("Graficar"); button_graficar.setEnabled(false); button_graficar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { button_graficarActionPerformed(evt); } }); tabla2.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { }, new String[] { })); jScrollPane3.setViewportView(tabla2); 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() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jRadioButton3).addComponent(jRadioButton2).addComponent(jRadioButton1) .addComponent(jLabel2).addComponent(jButton1).addComponent(button_graficar) .addComponent(cantidadNumeros)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE) .addGap(20, 20, 20))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cantidadNumeros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jRadioButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jRadioButton2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jRadioButton3).addGap(29, 29, 29).addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(button_graficar).addGap(0, 0, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup().addGap(19, 19, 19) .addGroup(layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 538, Short.MAX_VALUE) .addComponent(jScrollPane3)))) .addContainerGap())); pack(); setLocationRelativeTo(null); }
From source file:gtu._work.ui.ObnfExceptionLogDownloadUI.java
private void initGUI() { try {/* w w w. j a v a 2 s. c o m*/ JCommonUtil.frameCloseConfirm(this); BorderLayout thisLayout = new BorderLayout(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); getContentPane().setLayout(thisLayout); { jTabbedPane1 = new JTabbedPane(); getContentPane().add(jTabbedPane1, BorderLayout.CENTER); { jPanel1 = new JPanel(); FlowLayout jPanel1Layout = new FlowLayout(); jTabbedPane1.addTab("", null, jPanel1, null); jPanel1.setLayout(jPanel1Layout); { jLabel1 = new JLabel(); jPanel1.add(jLabel1); jLabel1.setText("\u532f\u51fa\u76ee\u9304"); } { exportTextField = new JTextField(); JCommonUtil.jTextFieldSetFilePathMouseEvent(exportTextField, true); jPanel1.add(exportTextField); exportTextField.setPreferredSize(new java.awt.Dimension(187, 22)); } { jLabel2 = new JLabel(); jPanel1.add(jLabel2); jLabel2.setText("domainJar"); jLabel2.setPreferredSize(new java.awt.Dimension(56, 15)); } { domainJarText = new JTextField(); ObnfRepairDBBatch batch = new ObnfRepairDBBatch(); domainJarText.setText(batch.fetchDomainJar()); JCommonUtil.jTextFieldSetFilePathMouseEvent(domainJarText, false); jPanel1.add(domainJarText); domainJarText.setPreferredSize(new java.awt.Dimension(185, 22)); } { jScrollPane1 = new JScrollPane(); jPanel1.add(jScrollPane1); jScrollPane1.setPreferredSize(new java.awt.Dimension(512, 262)); { messageIdArea = new JTextArea(); jScrollPane1.setViewportView(messageIdArea); } } { DefaultComboBoxModel jComboBox1Model = new DefaultComboBoxModel(); for (FtpSite f : FtpSite.values()) { jComboBox1Model.addElement(f); } siteFtpComboBox = new JComboBox(); jPanel1.add(siteFtpComboBox); siteFtpComboBox.setModel(jComboBox1Model); } { downloadBtn = new JButton(); jPanel1.add(downloadBtn); downloadBtn.setText("\u4e0b\u8f09"); downloadBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { downloadBtnAction(); } }); } { makeReportBtn = new JButton(); jPanel1.add(makeReportBtn); makeReportBtn.setText("\u7522\u751f\u5831\u8868"); makeReportBtn.setPreferredSize(new java.awt.Dimension(102, 22)); makeReportBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { makeReportBtnPerformed(); } }); } } { jPanel2 = new JPanel(); BorderLayout jPanel2Layout = new BorderLayout(); jPanel2.setLayout(jPanel2Layout); jTabbedPane1.addTab("log", null, jPanel2, null); { jScrollPane2 = new JScrollPane(); jPanel2.add(jScrollPane2, BorderLayout.CENTER); jScrollPane2.setPreferredSize(new java.awt.Dimension(529, 340)); { logArea = new JTextArea(); jScrollPane2.setViewportView(logArea); } } } } pack(); this.setSize(542, 394); } catch (Exception e) { //add your error handling code here e.printStackTrace(); } }
From source file:gtu._work.etc.EnglishAdd.java
private void initGUI() { try {//from w ww .j a va 2s .co m BorderLayout thisLayout = new BorderLayout(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); getContentPane().setLayout(thisLayout); this.setPreferredSize(new java.awt.Dimension(400, 211)); { jTabbedPane1 = new JTabbedPane(); getContentPane().add(jTabbedPane1, BorderLayout.CENTER); jTabbedPane1.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent evt) { if (jTabbedPane1.getSelectedIndex() == 2) { // XXX } } }); { jPanel1 = new JPanel(); FlowLayout jPanel1Layout = new FlowLayout(); jPanel1.setLayout(jPanel1Layout); jTabbedPane1.addTab("add", null, jPanel1, null); jPanel1.setPreferredSize(new java.awt.Dimension(387, 233)); { showwordText = new JTextField(); jPanel1.add(showwordText); showwordText.setPreferredSize(new java.awt.Dimension(271, 23)); showwordText.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent evt) { if (evt.getKeyCode() == KeyEvent.VK_ENTER) { scanWord(); } } }); showwordText.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent evt) { scanWord(); } }); } { netChkBox = new JCheckBox(); jPanel1.add(netChkBox); netChkBox.setSelected(true); } { jScrollPane2 = new JScrollPane(); jPanel1.add(jScrollPane2); jScrollPane2.setPreferredSize(new java.awt.Dimension(364, 80)); { showChineseArea = new JTextArea(); jScrollPane2.setViewportView(showChineseArea); showChineseArea.setPreferredSize(new java.awt.Dimension(364, 80)); } } { setFileBtn = new JButton(); jPanel1.add(setFileBtn); setFileBtn.setText("set file"); setFileBtn.setPreferredSize(new java.awt.Dimension(261, 30)); setFileBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { File file = JCommonUtil._jFileChooser_selectFileOnly(); if (file == null) { JCommonUtil._jOptionPane_showMessageDialog_error("?!"); return; } currentFile = file; StringBuffer sb = new StringBuffer(); try { BufferedReader reader = new BufferedReader( new InputStreamReader(new FileInputStream(currentFile), "BIG5")); for (String line = null; (line = reader.readLine()) != null;) { sb.append(line + "\r\n"); } reader.close(); } catch (IOException e) { e.printStackTrace(); } wordTextArea.setText(sb.toString()); } }); } } { jPanel3 = new JPanel(); BorderLayout jPanel3Layout = new BorderLayout(); jPanel3.setLayout(jPanel3Layout); jTabbedPane1.addTab("word", null, jPanel3, null); { jScrollPane1 = new JScrollPane(); jPanel3.add(jScrollPane1, BorderLayout.CENTER); jScrollPane1.setPreferredSize(new java.awt.Dimension(387, 224)); { wordTextArea = new JTextArea(); jScrollPane1.setViewportView(wordTextArea); } } } } setDefaultSave(); pack(); this.setSize(400, 211); } catch (Exception e) { // add your error handling code here e.printStackTrace(); } }
From source file:StoppUhr.java
private void initGUI() { try {//from w w w. j a va 2 s .c o m AnchorLayout thisLayout = new AnchorLayout(); getContentPane().setLayout(thisLayout); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); this.setPreferredSize(new java.awt.Dimension(609, 394)); { jPanel3 = new JPanel(); GridBagLayout jPanel3Layout = new GridBagLayout(); jPanel3.setLayout(jPanel3Layout); getContentPane().add(jPanel3, new AnchorConstraint(668, 811, 978, 19, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL)); jPanel3.setPreferredSize(new java.awt.Dimension(384, 94)); { jScrollPane1 = new JScrollPane(); jPanel3.add(jScrollPane1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jScrollPane1.setPreferredSize(new java.awt.Dimension(300, 90)); { jTextArea = new JTextArea(); jScrollPane1.setViewportView(jTextArea); jTextArea.setText(""); } } { jTextFieldStNr = new JTextField(); jPanel3.add(jTextFieldStNr, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jTextFieldStNr.setText(""); jTextFieldStNr.setPreferredSize(new java.awt.Dimension(150, 90)); jTextFieldStNr.setHorizontalAlignment(JTextField.CENTER); jTextFieldStNr.setFont(new Font(Font.DIALOG, Font.BOLD, 40)); } jPanel3Layout.rowWeights = new double[] { 0.1 }; jPanel3Layout.rowHeights = new int[] { 7 }; jPanel3Layout.columnWeights = new double[] { 0.1, 0.1 }; jPanel3Layout.columnWidths = new int[] { 7, 7 }; } { jPanel2 = new JPanel(); GridBagLayout jPanel2Layout = new GridBagLayout(); jPanel2Layout.rowWeights = new double[] { 0.1, 0.1 }; jPanel2Layout.rowHeights = new int[] { 7, 7 }; jPanel2Layout.columnWeights = new double[] { 0.1 }; jPanel2Layout.columnWidths = new int[] { 7 }; jPanel2.setLayout(jPanel2Layout); getContentPane().add(jPanel2, new AnchorConstraint(47, 821, 721, 27, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL)); jPanel2.setPreferredSize(new java.awt.Dimension(363, 178)); { uhrzeitAusgabe = new JLabel(); jPanel2.add(uhrzeitAusgabe, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); uhrzeitAusgabe.setText("00:00:00"); uhrzeitAusgabe.setFont(new Font(Font.DIALOG, Font.BOLD, uhrFontSize)); } { stoppuhrAusgabe = new JLabel(); jPanel2.add(stoppuhrAusgabe, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); stoppuhrAusgabe.setText("00:00:00"); stoppuhrAusgabe.setFont(new Font(Font.DIALOG, Font.BOLD, uhrFontSize)); } } { jPanel1 = new JPanel(); GridBagLayout jPanel1Layout = new GridBagLayout(); getContentPane().add(jPanel1, new AnchorConstraint(48, 987, 954, 820, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL, AnchorConstraint.ANCHOR_REL)); jPanel1Layout.rowWeights = new double[] { 0.1, 0.1, 0.1, 1.0, 0.1 }; jPanel1Layout.rowHeights = new int[] { 1, 1, 1, 1, 1 }; jPanel1Layout.columnWeights = new double[] { 0.1 }; jPanel1Layout.columnWidths = new int[] { 7 }; jPanel1.setLayout(jPanel1Layout); jPanel1.setPreferredSize(new java.awt.Dimension(100, 330)); { startButton = new JButton(); jPanel1.add(startButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); startButton.setPreferredSize(new java.awt.Dimension(90, 30)); startButton.setText("Start"); } { resetButton = new JButton(); jPanel1.add(resetButton, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); resetButton.setText("Reset"); resetButton.setPreferredSize(new java.awt.Dimension(90, 30)); } { jPanel4 = new JPanel(); GridBagLayout jPanel4Layout = new GridBagLayout(); jPanel1.add(jPanel4, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jPanel4.setPreferredSize(new java.awt.Dimension(51, 81)); jPanel4Layout.rowWeights = new double[] { 0.1, 0.1, 0.1 }; jPanel4Layout.rowHeights = new int[] { 7, 7, 7 }; jPanel4Layout.columnWeights = new double[] { 0.1 }; jPanel4Layout.columnWidths = new int[] { 7 }; jPanel4.setLayout(jPanel4Layout); { plusButton = new JButton(); jPanel4.add(plusButton, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); plusButton.setText("+"); plusButton.setPreferredSize(new java.awt.Dimension(50, 30)); } { minusButton = new JButton(); jPanel4.add(minusButton, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); minusButton.setText("-"); minusButton.setPreferredSize(new java.awt.Dimension(50, 30)); } { jLabelFontSize = new JLabel(); jPanel4.add(jLabelFontSize, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabelFontSize.setFont(new Font(Font.DIALOG, Font.PLAIN, 10)); jLabelFontSize.setText("Font Size"); } } } this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent evt) { thisWindowClosing(evt); } }); startButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { startButtonListener(evt); } }); resetButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { resetButtonListener(evt); } }); jTextFieldStNr.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { try { stNrFieldListener(evt); } catch (IOException e) { e.printStackTrace(); } } }); plusButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { plusButtonListener(evt); } }); minusButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { minusButtonListener(evt); } }); pack(); this.setSize(609, 394); } catch (Exception e) { //add your error handling code here e.printStackTrace(); } }
From source file:gtu.jpa.hibernate.Rcdf002eDBUI.java
private void initGUI() { try {/* www. ja va2 s.com*/ BorderLayout thisLayout = new BorderLayout(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); getContentPane().setLayout(thisLayout); { jTabbedPane1 = new JTabbedPane(); getContentPane().add(jTabbedPane1, BorderLayout.CENTER); { jPanel1 = new JPanel(); jTabbedPane1.addTab("?", null, jPanel1, null); { executeBtn = new JButton(); jPanel1.add(executeBtn); executeBtn.setText("\u5f9e2e\u7522\u751fxml\u6a94"); executeBtn.setPreferredSize(new java.awt.Dimension(115, 36)); executeBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { executeBtnActionPerformed(evt); } }); } { isDebug = new JToggleButton(); jPanel1.add(isDebug); isDebug.setPreferredSize(new java.awt.Dimension(232, 38)); JCommonUtil.setJToggleButtonText(isDebug, new String[] { "SIT", "?" }); } { jLabel1 = new JLabel(); jPanel1.add(jLabel1); jLabel1.setText("\u8a2d\u5b9axml\u8def\u5f91"); } { xmlFileText = new JTextField(); jPanel1.add(xmlFileText); xmlFileText.setPreferredSize(new java.awt.Dimension(250, 24)); } { executeReportBtn = new JButton(); jPanel1.add(executeReportBtn); executeReportBtn.setText("\u81eaxml\u6a94\u7522\u751f\u7d71\u8a08\u6a94"); executeReportBtn.setPreferredSize(new java.awt.Dimension(227, 64)); executeReportBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { executeReportBtnActionPerformed(evt); } }); } } { jPanel2 = new JPanel(); BorderLayout jPanel2Layout = new BorderLayout(); jPanel2.setLayout(jPanel2Layout); jTabbedPane1.addTab("log", null, jPanel2, null); jTabbedPane1.addTab("excel", null, getJPanel3(), null); jTabbedPane1.addTab("??", null, getJPanel4(), null); jTabbedPane1.addTab("", null, getJPanel5(), null); { jScrollPane1 = new JScrollPane(); jPanel2.add(jScrollPane1, BorderLayout.CENTER); jScrollPane1.setPreferredSize(new java.awt.Dimension(407, 228)); { logArea = new JTextArea(); jScrollPane1.setViewportView(logArea); } } } } pack(); this.setSize(420, 282); initLog(); } catch (Exception e) { //add your error handling code here e.printStackTrace(); } }
From source file:com.iisigroup.ris.WebFileScanUtilBrowserUI.java
private void initGUI() { final SwingActionUtil swingUtil = (SwingActionUtil) SwingActionUtil.newInstance(this); try {//from w w w . j a va 2 s . c o m BorderLayout thisLayout = new BorderLayout(); getContentPane().setLayout(thisLayout); this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); this.setTitle("browser source code"); { informationMenu = new JPopupMenu(); setComponentPopupMenu(this, informationMenu); } { ListModel openFileListModel = new DefaultListModel(); openFileList = new JList(); openFileList.setModel(openFileListModel); getContentPane().add(openFileList, BorderLayout.NORTH); openFileList.setPreferredSize(new java.awt.Dimension(663, 281)); openFileList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent evt) { swingUtil.invokeAction("openFileList.valueChanged", evt); } }); openFileList.addMouseMotionListener(new MouseMotionAdapter() { public void mouseMoved(MouseEvent evt) { swingUtil.invokeAction("openFileList.mouseMoved", evt); } }); openFileList.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent evt) { swingUtil.invokeAction("openFileList.keyPressed", evt); } }); } { jPanel1 = new JPanel(); GroupLayout jPanel1Layout = new GroupLayout((JComponent) jPanel1); jPanel1.setLayout(jPanel1Layout); getContentPane().add(jPanel1, BorderLayout.SOUTH); jPanel1.setPreferredSize(new java.awt.Dimension(478, 35)); { openSelected = new JButton(); openSelected.setText("open all"); openSelected.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { swingUtil.invokeAction("openSelected.actionPerformed", evt); } }); } jPanel1Layout.setHorizontalGroup(jPanel1Layout.createSequentialGroup().addContainerGap(178, 178) .addComponent(openSelected, GroupLayout.PREFERRED_SIZE, 126, GroupLayout.PREFERRED_SIZE) .addContainerGap(174, Short.MAX_VALUE)); jPanel1Layout.setVerticalGroup(jPanel1Layout.createSequentialGroup().addGap(7) .addComponent(openSelected, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE) .addGap(0, 6, Short.MAX_VALUE)); } { informationMenu = new JPopupMenu(); } this.setSize(486, 350); this.setLocationRelativeTo(null); //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // ?tooltip //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx int initialDelay = ToolTipManager.sharedInstance().getInitialDelay(); ToolTipManager.sharedInstance().setInitialDelay(0); //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // ?tooltip //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx swingUtil.addAction("openFileList.mouseClicked", new Action() { public void action(EventObject evt) throws Exception { DefaultListModel model = (DefaultListModel) openFileList.getModel(); int pos = openFileList.getLeadSelectionIndex(); if (pos == -1) { return; } setOpenFileListToolTip(); MouseEvent eeev = (MouseEvent) evt; if (eeev.getClickCount() != 2) { return; } MFile file = (MFile) model.elementAt(pos); openSource(file.file); } }); final JListUtil jlistUtil = JListUtil.newInstance(openFileList); swingUtil.addAction("openFileList.keyPressed", new Action() { public void action(EventObject evt) throws Exception { jlistUtil.defaultJListKeyPressed((KeyEvent) evt); setOpenFileListToolTip(); } }); swingUtil.addAction("openSelected.actionPerformed", new Action() { public void action(EventObject evt) throws Exception { DefaultListModel model = (DefaultListModel) openFileList.getModel(); for (Enumeration<?> enu = model.elements(); enu.hasMoreElements();) { MFile file = (MFile) enu.nextElement(); openSource(file.file); } } }); swingUtil.addAction("openFileList.mouseMoved", new Action() { public void action(EventObject evt) throws Exception { setOpenFileListToolTip(); } }); swingUtil.addAction("openFileList.valueChanged", new Action() { public void action(EventObject evt) throws Exception { System.out.println(evt); setOpenFileListToolTip(); } }); } catch (Exception e) { e.printStackTrace(); } }
From source file:gui.SignUpGUI.java
public SignUpGUI() { super("Sign Up"); setResizable(false);/*from ww w. j av a2 s. c om*/ setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS)); setSize(500, 250); JPanel panelServer = new JPanel(); addComponentToPanel(panelServer, labelServer, textFieldServer); add(panelServer); JPanel panelPort = new JPanel(); addComponentToPanel(panelPort, labelPort, textFieldPort); add(panelPort); JPanel panelID = new JPanel(); addComponentToPanel(panelID, labelID, textFieldID); add(panelID); JPanel panelPassword = new JPanel(); pwdFieldPwd.setEchoChar('*'); pwdFieldConfirmPwd.setEchoChar('*'); addComponentToPanel(panelPassword, labelPassword, pwdFieldPwd); add(panelPassword); JPanel panelConfirmPwd = new JPanel(); addComponentToPanel(panelConfirmPwd, labelConfirmPwd, pwdFieldConfirmPwd); add(panelConfirmPwd); JPanel panelNickname = new JPanel(); addComponentToPanel(panelNickname, labelNickname, textFieldNickname); add(panelNickname); JPanel panelButton = new JPanel(); panelButton.setLayout(new FlowLayout()); buttonSignUp.addActionListener(new SignUpActionListener()); panelButton.add(buttonSignUp); add(panelButton); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); setVisible(true); }
From source file:com.kbotpro.ui.FieldWatcher.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents label2 = new JLabel(); updateRateSpinner = new JSpinner(); label3 = new JLabel(); scrollPane1 = new JScrollPane(); infoLabel = new JLabel(); //======== this ======== setTitle("Field Watch"); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); Container contentPane = getContentPane(); //---- label2 ---- label2.setText("Update rate:"); label2.setLabelFor(updateRateSpinner); //---- updateRateSpinner ---- updateRateSpinner.setModel(new SpinnerNumberModel(1.0, 0.1, null, 0.5)); //---- label3 ---- label3.setText("Times per second"); //======== scrollPane1 ======== {/*from ww w. j av a 2 s . com*/ //---- infoLabel ---- infoLabel.setText("Field info"); infoLabel.setVerticalAlignment(SwingConstants.TOP); scrollPane1.setViewportView(infoLabel); } GroupLayout contentPaneLayout = new GroupLayout(contentPane); contentPane.setLayout(contentPaneLayout); contentPaneLayout.setHorizontalGroup(contentPaneLayout.createParallelGroup() .add(contentPaneLayout.createSequentialGroup().addContainerGap().add(contentPaneLayout .createParallelGroup().add(scrollPane1, GroupLayout.DEFAULT_SIZE, 527, Short.MAX_VALUE) .add(contentPaneLayout.createSequentialGroup().add(label2) .addPreferredGap(LayoutStyle.RELATED) .add(updateRateSpinner, GroupLayout.PREFERRED_SIZE, 83, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.RELATED).add(label3))) .addContainerGap())); contentPaneLayout .setVerticalGroup(contentPaneLayout.createParallelGroup().add(GroupLayout.TRAILING, contentPaneLayout.createSequentialGroup().addContainerGap() .add(scrollPane1, GroupLayout.DEFAULT_SIZE, 351, Short.MAX_VALUE) .addPreferredGap(LayoutStyle.RELATED) .add(contentPaneLayout.createParallelGroup(GroupLayout.BASELINE).add(label2) .add(updateRateSpinner, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .add(label3)) .addContainerGap())); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:gtu._work.ui.CheckJavaClassPathUI.java
private void initGUI() { try {/*from w w w . j a va2s. c o m*/ BorderLayout thisLayout = new BorderLayout(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); getContentPane().setLayout(thisLayout); setTitle("??importjava"); { jTabbedPane1 = new JTabbedPane(); getContentPane().add(jTabbedPane1, BorderLayout.CENTER); { jPanel1 = new JPanel(); BorderLayout jPanel1Layout = new BorderLayout(); jPanel1.setLayout(jPanel1Layout); jTabbedPane1.addTab("", null, jPanel1, null); { classPathText = new JTextField(); jPanel1.add(classPathText, BorderLayout.NORTH); classPathText.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { if (StringUtils.isNotBlank(classPathText.getText())) { String text = classPathText.getText(); DefaultListModel model = (DefaultListModel) classPathList.getModel(); boolean findOk = false; for (int ii = 0; ii < model.size(); ii++) { String val = (String) model.getElementAt(ii); if (StringUtils.equals(val, text)) { findOk = true; } } if (!findOk) { model.addElement(text); } } } }); } { jScrollPane1 = new JScrollPane(); jPanel1.add(jScrollPane1, BorderLayout.CENTER); jScrollPane1.setPreferredSize(new java.awt.Dimension(492, 302)); { DefaultListModel classPathListModel = new DefaultListModel(); classPathList = new JList(); Set<String> clzSet = new HashSet<String>(); for (Enumeration<?> enu = configBean.getConfigProp().keys(); enu.hasMoreElements();) { String key = (String) enu.nextElement(); if (key.contains(CLASSNAME_KEY)) { clzSet.add(configBean.getConfigProp().getProperty(key)); } } for (String clzName : clzSet) { classPathListModel.addElement(clzName); } jScrollPane1.setViewportView(classPathList); classPathList.setModel(classPathListModel); classPathList.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent evt) { JListUtil.newInstance(classPathList).defaultJListKeyPressed(evt); } }); } } { executeBtn = new JButton(); jPanel1.add(executeBtn, BorderLayout.WEST); executeBtn.setText("\u57f7\u884c"); executeBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { executeBtnActionPerformed(evt); } }); } { srcPathText = new JTextField(); if (configBean.getConfigProp().containsKey(SRCPATHTEXT_KEY)) { srcPathText.setText(configBean.getConfigProp().getProperty(SRCPATHTEXT_KEY)); } jPanel1.add(srcPathText, BorderLayout.SOUTH); JCommonUtil.jTextFieldSetFilePathMouseEvent(srcPathText, true); } } { jPanel2 = new JPanel(); BorderLayout jPanel2Layout = new BorderLayout(); jPanel2.setLayout(jPanel2Layout); jTabbedPane1.addTab("log", null, jPanel2, null); { jScrollPane2 = new JScrollPane(); jPanel2.add(jScrollPane2, BorderLayout.CENTER); jScrollPane2.setPreferredSize(new java.awt.Dimension(530, 350)); { logArea = new JTextArea(); jScrollPane2.setViewportView(logArea); } } } } pack(); this.setSize(551, 417); } catch (Exception e) { //add your error handling code here e.printStackTrace(); } }