Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import javax.swing.JFileChooser;
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- *
- * @author dmallory
- */
- public class GenomeGUI extends javax.swing.JFrame {
- /**
- * Creates new form GenomeGUI
- */
- public GenomeGUI() {
- 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">
- private void initComponents() {
- jInternalFrame1 = new javax.swing.JInternalFrame();
- jLabel3 = new javax.swing.JLabel();
- jTextField1 = new javax.swing.JTextField();
- jButton1 = new javax.swing.JButton();
- jComboBox1 = new javax.swing.JComboBox();
- jLabel1 = new javax.swing.JLabel();
- jLabel4 = new javax.swing.JLabel();
- jTextField2 = new javax.swing.JTextField();
- jButton2 = new javax.swing.JButton();
- jButton3 = new javax.swing.JButton();
- jScrollPane1 = new javax.swing.JScrollPane();
- jTextPane1 = new javax.swing.JTextPane();
- setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
- jInternalFrame1.setVisible(true);
- jLabel3.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
- jLabel3.setForeground(new java.awt.Color(255, 0, 0));
- jLabel3.setText("1. Choose Genome File");
- jTextField1.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jTextField1ActionPerformed(evt);
- }
- });
- jButton1.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
- jButton1.setForeground(new java.awt.Color(0, 0, 204));
- jButton1.setText("Browse");
- jButton1.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jButton1ActionPerformed(evt);
- }
- });
- jComboBox1.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
- jComboBox1.setForeground(new java.awt.Color(0, 51, 255));
- jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
- jLabel1.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
- jLabel1.setForeground(new java.awt.Color(255, 0, 0));
- jLabel1.setText("2. Choose Motif");
- jLabel4.setFont(new java.awt.Font("Times New Roman", 0, 18)); // NOI18N
- jLabel4.setForeground(new java.awt.Color(255, 0, 0));
- jLabel4.setText("3. Choose Output File");
- jButton2.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
- jButton2.setForeground(new java.awt.Color(0, 0, 255));
- jButton2.setText("Browse");
- jButton2.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jButton2ActionPerformed(evt);
- }
- });
- jButton3.setFont(new java.awt.Font("Times New Roman", 0, 24)); // NOI18N
- jButton3.setForeground(new java.awt.Color(0, 0, 255));
- jButton3.setText("Run Program");
- jButton3.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jButton3ActionPerformed(evt);
- }
- });
- jTextPane1.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
- jTextPane1.setForeground(new java.awt.Color(0, 0, 255));
- jTextPane1.setText("But the Republican idealism hasn't been working for you, has it?\n\n\"It could!\"\n\n-Random Mississipian Redneck");
- jScrollPane1.setViewportView(jTextPane1);
- org.jdesktop.layout.GroupLayout jInternalFrame1Layout = new org.jdesktop.layout.GroupLayout(jInternalFrame1.getContentPane());
- jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
- jInternalFrame1Layout.setHorizontalGroup(
- jInternalFrame1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(jInternalFrame1Layout.createSequentialGroup()
- .add(186, 186, 186)
- .add(jButton2)
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .add(jInternalFrame1Layout.createSequentialGroup()
- .add(27, 27, 27)
- .add(jInternalFrame1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(jTextField2)
- .add(jInternalFrame1Layout.createSequentialGroup()
- .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 211, Short.MAX_VALUE)
- .add(276, 276, 276))
- .add(jTextField1)
- .add(jInternalFrame1Layout.createSequentialGroup()
- .add(jInternalFrame1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(jButton3)
- .add(jInternalFrame1Layout.createSequentialGroup()
- .add(jLabel1)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .add(jInternalFrame1Layout.createSequentialGroup()
- .add(jLabel3)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(jButton1))
- .add(jLabel4))
- .add(0, 0, Short.MAX_VALUE)))
- .addContainerGap())
- );
- jInternalFrame1Layout.setVerticalGroup(
- jInternalFrame1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(org.jdesktop.layout.GroupLayout.TRAILING, jInternalFrame1Layout.createSequentialGroup()
- .add(22, 22, 22)
- .add(jInternalFrame1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
- .add(jLabel3)
- .add(jButton1))
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 29, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
- .add(jInternalFrame1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
- .add(jLabel1)
- .add(jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .add(10, 10, 10)
- .add(jInternalFrame1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
- .add(jLabel4)
- .add(jButton2))
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(jTextField2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 108, Short.MAX_VALUE)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(jButton3)
- .add(34, 34, 34))
- );
- org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(jInternalFrame1)
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(layout.createSequentialGroup()
- .add(jInternalFrame1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(0, 0, Short.MAX_VALUE))
- );
- pack();
- }// </editor-fold>
- private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
- JFileChooser chooser = new JFileChooser();
- int returnVal = chooser.showOpenDialog(this);
- if(returnVal == JFileChooser.APPROVE_OPTION)
- {
- File selectedFile = chooser.getSelectedFile();
- String fileName = selectedFile.getAbsolutePath();
- jTextField1.setText(fileName);
- }
- }
- private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- }
- private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
- JFileChooser chooser = new JFileChooser();
- int returnVal = chooser.showOpenDialog(this);
- if(returnVal == JFileChooser.APPROVE_OPTION)
- {
- File selectedFile = chooser.getSelectedFile();
- String fileName = selectedFile.getAbsolutePath();
- jTextField2.setText(fileName);
- }
- }
- private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- }
- /**
- * @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(GenomeGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (InstantiationException ex) {
- java.util.logging.Logger.getLogger(GenomeGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (IllegalAccessException ex) {
- java.util.logging.Logger.getLogger(GenomeGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (javax.swing.UnsupportedLookAndFeelException ex) {
- java.util.logging.Logger.getLogger(GenomeGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- }
- //</editor-fold>
- /* Create and display the form */
- java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
- new GenomeGUI().setVisible(true);
- }
- });
- }
- // Variables declaration - do not modify
- private javax.swing.JButton jButton1;
- private javax.swing.JButton jButton2;
- private javax.swing.JButton jButton3;
- private javax.swing.JComboBox jComboBox1;
- private javax.swing.JInternalFrame jInternalFrame1;
- private javax.swing.JLabel jLabel1;
- private javax.swing.JLabel jLabel3;
- private javax.swing.JLabel jLabel4;
- private javax.swing.JScrollPane jScrollPane1;
- private javax.swing.JTextField jTextField1;
- private javax.swing.JTextField jTextField2;
- private javax.swing.JTextPane jTextPane1;
- // End of variables declaration
- }
Advertisement
Add Comment
Please, Sign In to add comment