private void jButton2ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton2ActionPerformed try { ThreadBrowserClass ThreadBrowser = new ThreadBrowserClass(configuration, log, new javax.swing.JTable(), this); ThreadBrowser.initializeTable(); selectDialogClass selector = new selectDialogClass(configuration, log, this, ThreadBrowser, "Select Thread"); // dont want to allow this, for example selector.getNewButton().setEnabled(false); selector.getDeleteButton().setEnabled(false); parentID = selector.showDialog(); if (parentID < 0) { throw new KExceptionClass("You must select a Thread !", null); } else { LblThreadID.setText(Long.toString(parentID)); persistentObjectManagerClass persistentObjectManager = new persistentObjectManagerClass(configuration, log); ThreadClass Thread = new ThreadClass(); Thread = (ThreadClass) persistentObjectManager.copy4(parentID, ThreadClass.class); LblThreadName.setText(Thread.getThread()); LblSize.setText(Thread.getUkuran()); LblPart.setText(Thread.getPart()); } } catch (Exception error) { log.log(this, KMetaUtilsClass.getStackTrace(error)); KMetaUtilsClass.showErrorMessageFromException(this, error); } } // GEN-LAST:event_jButton2ActionPerformed
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { clientDiscountGroup = new javax.swing.ButtonGroup(); okButton = new javax.swing.JButton(); CancelButton = new javax.swing.JButton(); applyButton = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); lblID = new javax.swing.JLabel(); ID = new javax.swing.JLabel(); lblNama = new javax.swing.JLabel(); system_user_id1 = new javax.swing.JLabel(); lblID1 = new javax.swing.JLabel(); lblNama1 = new javax.swing.JLabel(); createdbyLbl = new javax.swing.JLabel(); vl = new javax.swing.JLabel(); LblAuditUser = new javax.swing.JLabel(); lblTelp1 = new javax.swing.JLabel(); jButton2 = new javax.swing.JButton(); LblThreadID = new javax.swing.JLabel(); LblSize = new javax.swing.JLabel(); lblTelp2 = new javax.swing.JLabel(); LblPart = new javax.swing.JLabel(); lblTelp39 = new javax.swing.JLabel(); qtyLabel26 = new javax.swing.JTextField(); LblThreadName = new javax.swing.JLabel(); lblTelp42 = new javax.swing.JLabel(); lblTelp43 = new javax.swing.JLabel(); LblTotalMeter = new javax.swing.JLabel(); qtyLabel27 = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setResizable(false); addWindowListener( new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { closeDialog(evt); } }); okButton.setFont(new java.awt.Font("Arial", 0, 10)); // NOI18N okButton.setText("Ok"); okButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { okButtonActionPerformed(evt); } }); CancelButton.setFont(new java.awt.Font("Arial", 0, 10)); // NOI18N CancelButton.setText("Cancel"); CancelButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { CloseButtonActionPerformed(evt); } }); applyButton.setFont(new java.awt.Font("Arial", 0, 10)); // NOI18N applyButton.setText("Apply"); // NOI18N applyButton.setName("applyButton"); // NOI18N applyButton.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { applyButtonActionPerformed(evt); } }); jPanel1.setBackground(new java.awt.Color(255, 255, 255)); jPanel1.setBorder( javax.swing.BorderFactory.createTitledBorder( javax.swing.BorderFactory.createEtchedBorder(), "Sewing Thread Count", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 3, 10))); // NOI18N jPanel1.setFont(new java.awt.Font("Dialog", 0, 10)); // NOI18N lblID.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N lblID.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); lblID.setText("ID"); ID.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N ID.setBorder(javax.swing.BorderFactory.createEtchedBorder()); ID.setName("ID"); // NOI18N lblNama.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N lblNama.setText("Thread"); system_user_id1.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N system_user_id1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); system_user_id1.setName("HdrID"); // NOI18N lblID1.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N lblID1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); lblID1.setText("HDRID"); lblNama1.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N lblNama1.setText("AuditDate"); createdbyLbl.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N createdbyLbl.setBorder(javax.swing.BorderFactory.createEtchedBorder()); createdbyLbl.setName("AuditDate"); // NOI18N vl.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N vl.setText("AuditUser"); LblAuditUser.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N LblAuditUser.setBorder(javax.swing.BorderFactory.createEtchedBorder()); LblAuditUser.setName("AuditUser"); // NOI18N lblTelp1.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N lblTelp1.setText("Size"); jButton2.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N jButton2.setText("Pick Thread"); jButton2.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); LblThreadID.setFont(new java.awt.Font("Arial", 0, 10)); // NOI18N LblThreadID.setBorder(javax.swing.BorderFactory.createEtchedBorder()); LblThreadID.setName("ThreadID"); // NOI18N LblSize.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N LblSize.setBorder(javax.swing.BorderFactory.createEtchedBorder()); LblSize.setName("Ukuran"); // NOI18N lblTelp2.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N lblTelp2.setText("Part"); LblPart.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N LblPart.setBorder(javax.swing.BorderFactory.createEtchedBorder()); LblPart.setName("Part"); // NOI18N lblTelp39.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N lblTelp39.setText("Total Inch"); qtyLabel26.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N qtyLabel26.setName("TotalInch"); // NOI18N qtyLabel26.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { qtyLabel26ActionPerformed(evt); } }); LblThreadName.setFont(new java.awt.Font("Arial", 0, 10)); // NOI18N LblThreadName.setBorder(javax.swing.BorderFactory.createEtchedBorder()); LblThreadName.setName("ThreadName"); // NOI18N lblTelp42.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N lblTelp42.setText("Total Meter"); lblTelp43.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N lblTelp43.setText("Remark"); LblTotalMeter.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N LblTotalMeter.setBorder(javax.swing.BorderFactory.createEtchedBorder()); LblTotalMeter.setName("TotalMeter"); // NOI18N qtyLabel27.setFont(new java.awt.Font("Verdana", 0, 10)); // NOI18N qtyLabel27.setName("Remark"); // NOI18N qtyLabel27.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { qtyLabel27ActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel1Layout .createSequentialGroup() .add( jPanel1Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel1Layout .createSequentialGroup() .add(53, 53, 53) .add( jPanel1Layout .createParallelGroup( org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel1Layout .createSequentialGroup() .add(lblTelp2) .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED) .add( LblPart, org.jdesktop.layout.GroupLayout .DEFAULT_SIZE, org.jdesktop.layout.GroupLayout .DEFAULT_SIZE, Short.MAX_VALUE)) .add( jPanel1Layout .createSequentialGroup() .add( jPanel1Layout .createParallelGroup( org.jdesktop.layout.GroupLayout .LEADING) .add( org.jdesktop.layout.GroupLayout .TRAILING, lblID) .add( org.jdesktop.layout.GroupLayout .TRAILING, lblID1) .add( org.jdesktop.layout.GroupLayout .TRAILING, lblNama) .add( org.jdesktop.layout.GroupLayout .TRAILING, lblTelp1)) .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED) .add( jPanel1Layout .createParallelGroup( org.jdesktop.layout.GroupLayout .LEADING) .add( LblSize, org.jdesktop.layout.GroupLayout .DEFAULT_SIZE, org.jdesktop.layout.GroupLayout .DEFAULT_SIZE, Short.MAX_VALUE) .add( jPanel1Layout .createSequentialGroup() .add( jPanel1Layout .createParallelGroup( org.jdesktop.layout .GroupLayout .LEADING) .add( jPanel1Layout .createSequentialGroup() .add( LblThreadID, org.jdesktop .layout .GroupLayout .PREFERRED_SIZE, 36, org.jdesktop .layout .GroupLayout .PREFERRED_SIZE) .addPreferredGap( org.jdesktop .layout .LayoutStyle .RELATED) .add( LblThreadName, org.jdesktop .layout .GroupLayout .DEFAULT_SIZE, org.jdesktop .layout .GroupLayout .DEFAULT_SIZE, Short .MAX_VALUE)) .add( system_user_id1, org.jdesktop.layout .GroupLayout .DEFAULT_SIZE, org.jdesktop.layout .GroupLayout .DEFAULT_SIZE, Short.MAX_VALUE) .add( ID, org.jdesktop.layout .GroupLayout .DEFAULT_SIZE, org.jdesktop.layout .GroupLayout .DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap( org.jdesktop.layout .LayoutStyle.UNRELATED) .add(jButton2) .add(14, 14, 14)))) .add( jPanel1Layout .createSequentialGroup() .add(10, 10, 10) .add( jPanel1Layout .createParallelGroup( org.jdesktop.layout.GroupLayout .TRAILING) .add( jPanel1Layout .createSequentialGroup() .add(lblTelp39) .addPreferredGap( org.jdesktop.layout .LayoutStyle.RELATED) .add( qtyLabel26, org.jdesktop.layout .GroupLayout .PREFERRED_SIZE, 286, org.jdesktop.layout .GroupLayout .PREFERRED_SIZE) .add(0, 18, Short.MAX_VALUE)) .add( jPanel1Layout .createSequentialGroup() .add(lblTelp42) .addPreferredGap( org.jdesktop.layout .LayoutStyle.RELATED) .add( LblTotalMeter, org.jdesktop.layout .GroupLayout .DEFAULT_SIZE, org.jdesktop.layout .GroupLayout .DEFAULT_SIZE, Short.MAX_VALUE)))))) .add( jPanel1Layout .createSequentialGroup() .addContainerGap() .add( jPanel1Layout .createParallelGroup( org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel1Layout .createParallelGroup( org.jdesktop.layout.GroupLayout.TRAILING) .add( jPanel1Layout .createSequentialGroup() .add(vl) .addPreferredGap( org.jdesktop.layout.LayoutStyle .RELATED) .add( LblAuditUser, org.jdesktop.layout.GroupLayout .PREFERRED_SIZE, 276, org.jdesktop.layout.GroupLayout .PREFERRED_SIZE)) .add( jPanel1Layout .createSequentialGroup() .add(lblNama1) .addPreferredGap( org.jdesktop.layout.LayoutStyle .RELATED) .add( createdbyLbl, org.jdesktop.layout.GroupLayout .PREFERRED_SIZE, 276, org.jdesktop.layout.GroupLayout .PREFERRED_SIZE))) .add(lblTelp43)) .add(0, 0, Short.MAX_VALUE)) .add(org.jdesktop.layout.GroupLayout.TRAILING, qtyLabel27)) .addContainerGap())); jPanel1Layout.setVerticalGroup( jPanel1Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel1Layout .createSequentialGroup() .add(2, 2, 2) .add( jPanel1Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) .add( jPanel1Layout .createSequentialGroup() .add( jPanel1Layout .createParallelGroup( org.jdesktop.layout.GroupLayout.CENTER) .add( lblID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add( ID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( jPanel1Layout .createParallelGroup( org.jdesktop.layout.GroupLayout.CENTER) .add( lblID1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add( system_user_id1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( jPanel1Layout .createParallelGroup( org.jdesktop.layout.GroupLayout.CENTER) .add(lblNama) .add( LblThreadID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(org.jdesktop.layout.GroupLayout.TRAILING, jButton2) .add( LblThreadName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( jPanel1Layout .createParallelGroup( org.jdesktop.layout.GroupLayout.TRAILING) .add(lblTelp1) .add( LblSize, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( jPanel1Layout .createParallelGroup( org.jdesktop.layout.GroupLayout.TRAILING) .add(lblTelp2) .add( LblPart, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( jPanel1Layout .createParallelGroup( org.jdesktop.layout.GroupLayout.CENTER) .add( qtyLabel26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(lblTelp39)) .add(8, 8, 8) .add(lblTelp42)) .add( LblTotalMeter, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(48, 48, 48) .add(lblTelp43) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( qtyLabel27, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 87, Short.MAX_VALUE) .add( jPanel1Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout .createSequentialGroup() .add( jPanel1Layout .createParallelGroup( org.jdesktop.layout.GroupLayout.TRAILING) .add(lblNama1) .add( createdbyLbl, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( LblAuditUser, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .add(org.jdesktop.layout.GroupLayout.TRAILING, vl)) .addContainerGap( org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( layout .createSequentialGroup() .add( jPanel1, 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( layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( okButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add( CancelButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add( applyButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); layout.setVerticalGroup( layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( layout .createSequentialGroup() .add(41, 41, 41) .add( okButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(10, 10, 10) .add( CancelButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(10, 10, 10) .add( applyButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .add( layout .createSequentialGroup() .add( jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(0, 22, Short.MAX_VALUE))); } // </editor-fold>//GEN-END:initComponents