Circuit Negma

C++, C, VB.NET, PCB, Electronics, Circuit Design

Photo Grabber

Posted by Circuit Negma on March 2, 2006


I am currently working on building a simple file grabber. it is not finished yet

======================================

The main Panel :

G:\Documents and Settings\nemo\My Documents\Programming\Java\url\src\url\urlGUI.java
  1 /*
  2  * urlGUI.java
  3  *
  4  * Created on March 1, 2006, 11:27 AM
  5  */
  6 
  7 package url;
  8 
  9 /**
 10  *
 11  * @author  nemo
 12  */
 13 public class urlGUI extends javax.swing.JFrame {
 14     
 15     // <editor-fold defaultstate="collapsed" desc=" Variable declaration">
 16     
 17     protected static String FileNamestr1;
 18     protected static String FileNamestr2;
 19     protected static boolean FileNameflag;
 20     
 21     // </editor-fold>
 22    
 23     // <editor-fold defaultstate="collapsed" desc=" Creates new form urlGUI">
 24     /** Creates new form urlGUI */
 25     public urlGUI() {
 26         initComponents();
 27     } //</editor-fold>
 28     
 29     /** This method is called from within the constructor to
 30      * initialize the form.
 31      * WARNING: Do NOT modify this code. The content of this method is
 32      * always regenerated by the Form Editor.
 33      */
 34     
 35     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                          
 36     private void initComponents() {
 37         jPanel1 = new javax.swing.JPanel();
 38         jLabel1 = new javax.swing.JLabel();
 39         jTextField1 = new javax.swing.JTextField();
 40         jLabel2 = new javax.swing.JLabel();
 41         jTextField2 = new javax.swing.JTextField();
 42         jLabel3 = new javax.swing.JLabel();
 43         jTextField3 = new javax.swing.JTextField();
 44         jLabel4 = new javax.swing.JLabel();
 45         jTextField4 = new javax.swing.JTextField();
 46         jButton4 = new javax.swing.JButton();
 47         jPanel2 = new javax.swing.JPanel();
 48         jPanel3 = new javax.swing.JPanel();
 49         jScrollPane1 = new javax.swing.JScrollPane();
 50         jList1 = new javax.swing.JList();
 51         jPanel4 = new javax.swing.JPanel();
 52         jScrollPane2 = new javax.swing.JScrollPane();
 53         jList2 = new javax.swing.JList();
 54         jPanel5 = new javax.swing.JPanel();
 55         jScrollPane3 = new javax.swing.JScrollPane();
 56         jTextArea1 = new javax.swing.JTextArea();
 57         jPanel6 = new javax.swing.JPanel();
 58         jButton1 = new javax.swing.JButton();
 59         jButton2 = new javax.swing.JButton();
 60         jButton3 = new javax.swing.JButton();
 61         jPanel7 = new javax.swing.JPanel();
 62 
 63         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
 64         jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Input", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12)));
 65         jLabel1.setText("Url Address: ");
 66         jLabel1.setToolTipText("The Destination Address of Gallery");
 67 
 68         jTextField1.setToolTipText("The Destination Address with Filename not included");
 69 
 70         jLabel2.setText("File Name: ");
 71 
 72         jLabel3.setText("Start #: ");
 73 
 74         jLabel4.setText("End #: ");
 75 
 76         jButton4.setText("Advanced");
 77         jButton4.addActionListener(new java.awt.event.ActionListener() {
 78             public void actionPerformed(java.awt.event.ActionEvent evt) {
 79                 jButton4ActionPerformed(evt);
 80             }
 81         });
 82 
 83         org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
 84         jPanel1.setLayout(jPanel1Layout);
 85         jPanel1Layout.setHorizontalGroup(
 86             jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 87             .add(jPanel1Layout.createSequentialGroup()
 88                 .addContainerGap()
 89                 .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 90                     .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel3)
 91                     .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel2)
 92                     .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel1))
 93                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 94                 .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 95                     .add(jPanel1Layout.createSequentialGroup()
 96                         .add(jTextField2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 194, Short.MAX_VALUE)
 97                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 98                         .add(jButton4)
 99                         .addContainerGap())
100                     .add(jTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 293, Short.MAX_VALUE)
101                     .add(jPanel1Layout.createSequentialGroup()
102                         .add(jTextField3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 95, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
103                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 21, Short.MAX_VALUE)
104                         .add(jLabel4)
105                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
106                         .add(jTextField4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 111, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
107                         .addContainerGap())))
108         );
109 
110         jPanel1Layout.linkSize(new java.awt.Component[] {jTextField3, jTextField4}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
111 
112         jPanel1Layout.setVerticalGroup(
113             jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
114             .add(jPanel1Layout.createSequentialGroup()
115                 .addContainerGap()
116                 .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
117                     .add(jLabel1)
118                     .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
119                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
120                 .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
121                     .add(jLabel2)
122                     .add(jTextField2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
123                     .add(jButton4))
124                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
125                 .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
126                     .add(jLabel3)
127                     .add(jTextField3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
128                     .add(jTextField4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 20, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
129                     .add(jLabel4))
130                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
131         );
132 
133         jPanel1Layout.linkSize(new java.awt.Component[] {jTextField3, jTextField4}, org.jdesktop.layout.GroupLayout.VERTICAL);
134 
135         jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Tags", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12)));
136         jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "File Ext.", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12)));
137         jList1.setModel(new javax.swing.AbstractListModel() {
138             String[] strings = { "jpg", "JPG", "bmp", "BMP", "gif", "GIF", "Custom" };
139             public int getSize() { return strings.length; }
140             public Object getElementAt(int i) { return strings[i]; }
141         });
142         jScrollPane1.setViewportView(jList1);
143 
144         org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
145         jPanel3.setLayout(jPanel3Layout);
146         jPanel3Layout.setHorizontalGroup(
147             jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
148             .add(jPanel3Layout.createSequentialGroup()
149                 .addContainerGap()
150                 .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE)
151                 .addContainerGap())
152         );
153         jPanel3Layout.setVerticalGroup(
154             jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
155             .add(jPanel3Layout.createSequentialGroup()
156                 .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 97, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
157                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
158         );
159 
160         jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Tags", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12)));
161         jList2.setModel(new javax.swing.AbstractListModel() {
162             String[] strings = { "<img> ... </img>", "[img] ... [/img]", "[IMG] ... [/IMG]", "Custom" };
163             public int getSize() { return strings.length; }
164             public Object getElementAt(int i) { return strings[i]; }
165         });
166         jScrollPane2.setViewportView(jList2);
167 
168         org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
169         jPanel4.setLayout(jPanel4Layout);
170         jPanel4Layout.setHorizontalGroup(
171             jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
172             .add(jPanel4Layout.createSequentialGroup()
173                 .addContainerGap()
174                 .add(jScrollPane2)
175                 .addContainerGap())
176         );
177         jPanel4Layout.setVerticalGroup(
178             jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
179             .add(jPanel4Layout.createSequentialGroup()
180                 .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 76, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
181                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
182         );
183 
184         org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
185         jPanel2.setLayout(jPanel2Layout);
186         jPanel2Layout.setHorizontalGroup(
187             jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
188             .add(jPanel2Layout.createSequentialGroup()
189                 .addContainerGap()
190                 .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
191                     .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
192                     .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
193                 .addContainerGap())
194         );
195         jPanel2Layout.setVerticalGroup(
196             jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
197             .add(jPanel2Layout.createSequentialGroup()
198                 .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
199                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
200                 .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
201                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
202         );
203 
204         jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Output", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12)));
205         jTextArea1.setColumns(20);
206         jTextArea1.setRows(5);
207         jTextArea1.setToolTipText("Output Results");
208         jScrollPane3.setViewportView(jTextArea1);
209 
210         org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5);
211         jPanel5.setLayout(jPanel5Layout);
212         jPanel5Layout.setHorizontalGroup(
213             jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
214             .add(jPanel5Layout.createSequentialGroup()
215                 .addContainerGap()
216                 .add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE)
217                 .addContainerGap())
218         );
219         jPanel5Layout.setVerticalGroup(
220             jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
221             .add(jPanel5Layout.createSequentialGroup()
222                 .add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
223                 .addContainerGap())
224         );
225 
226         jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Navigation", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12)));
227         jButton1.setText("Run");
228 
229         jButton2.setText("Clear");
230         jButton2.addActionListener(new java.awt.event.ActionListener() {
231             public void actionPerformed(java.awt.event.ActionEvent evt) {
232                 jButton2ActionPerformed(evt);
233             }
234         });
235 
236         jButton3.setText("Stop");
237 
238         org.jdesktop.layout.GroupLayout jPanel6Layout = new org.jdesktop.layout.GroupLayout(jPanel6);
239         jPanel6.setLayout(jPanel6Layout);
240         jPanel6Layout.setHorizontalGroup(
241             jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
242             .add(jPanel6Layout.createSequentialGroup()
243                 .addContainerGap(235, Short.MAX_VALUE)
244                 .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
245                     .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel6Layout.createSequentialGroup()
246                         .add(jButton1)
247                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
248                         .add(jButton2)
249                         .addContainerGap())
250                     .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel6Layout.createSequentialGroup()
251                         .add(jButton3)
252                         .add(34, 34, 34))))
253         );
254 
255         jPanel6Layout.linkSize(new java.awt.Component[] {jButton1, jButton2}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
256 
257         jPanel6Layout.setVerticalGroup(
258             jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
259             .add(jPanel6Layout.createSequentialGroup()
260                 .addContainerGap()
261                 .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
262                     .add(jButton1)
263                     .add(jButton2))
264                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
265                 .add(jButton3)
266                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
267         );
268 
269         jPanel6Layout.linkSize(new java.awt.Component[] {jButton1, jButton2}, org.jdesktop.layout.GroupLayout.VERTICAL);
270 
271         jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Thumb Strip", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12)));
272         org.jdesktop.layout.GroupLayout jPanel7Layout = new org.jdesktop.layout.GroupLayout(jPanel7);
273         jPanel7.setLayout(jPanel7Layout);
274         jPanel7Layout.setHorizontalGroup(
275             jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
276             .add(0, 100, Short.MAX_VALUE)
277         );
278         jPanel7Layout.setVerticalGroup(
279             jPanel7Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
280             .add(0, 503, Short.MAX_VALUE)
281         );
282 
283         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
284         getContentPane().setLayout(layout);
285         layout.setHorizontalGroup(
286             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
287             .add(layout.createSequentialGroup()
288                 .addContainerGap()
289                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
290                     .add(jPanel6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
291                     .add(layout.createSequentialGroup()
292                         .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
293                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
294                         .add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
295                     .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
296                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
297                 .add(jPanel7, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
298                 .addContainerGap())
299         );
300         layout.setVerticalGroup(
301             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
302             .add(layout.createSequentialGroup()
303                 .addContainerGap()
304                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
305                     .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel7, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
306                     .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
307                         .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
308                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
309                         .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
310                             .add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
311                             .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
312                         .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
313                         .add(jPanel6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
314                 .addContainerGap(34, Short.MAX_VALUE))
315         );
316         pack();
317     }// </editor-fold>                        
318 
319     // advanced button action
320     private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                         
321 // TODO add your handling code here:
322         new FileAdvancedGUI().setVisible(true);
323     }                                        
324 
325     // clear button action
326     private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
327 // TODO add your handling code here:
328         this.jTextField1.setText("");
329         this.jTextField2.setText("");
330         this.jTextField3.setText("");
331         this.jTextField4.setText("");
332         this.jTextArea1.setText("");
333         this.jList1.clearSelection();
334         this.jList2.clearSelection();
335     }                                        
336     
337     /**
338      * @param args the command line arguments
339      */
340     public static void main(String args[]) {
341         java.awt.EventQueue.invokeLater(new Runnable() {
342             public void run() {
343                 new urlGUI().setVisible(true);
344             }
345         });
346     }
347     
348     // <editor-fold defaultstate="collapsed" desc="Variables Desclaration">
349     // Variables declaration - do not modify                     
350     private javax.swing.JButton jButton1;
351     private javax.swing.JButton jButton2;
352     private javax.swing.JButton jButton3;
353     private javax.swing.JButton jButton4;
354     private javax.swing.JLabel jLabel1;
355     private javax.swing.JLabel jLabel2;
356     private javax.swing.JLabel jLabel3;
357     private javax.swing.JLabel jLabel4;
358     private javax.swing.JList jList1;
359     private javax.swing.JList jList2;
360     private javax.swing.JPanel jPanel1;
361     private javax.swing.JPanel jPanel2;
362     private javax.swing.JPanel jPanel3;
363     private javax.swing.JPanel jPanel4;
364     private javax.swing.JPanel jPanel5;
365     private javax.swing.JPanel jPanel6;
366     private javax.swing.JPanel jPanel7;
367     private javax.swing.JScrollPane jScrollPane1;
368     private javax.swing.JScrollPane jScrollPane2;
369     private javax.swing.JScrollPane jScrollPane3;
370     private javax.swing.JTextArea jTextArea1;
371     private javax.swing.JTextField jTextField1;
372     private javax.swing.JTextField jTextField2;
373     private javax.swing.JTextField jTextField3;
374     private javax.swing.JTextField jTextField4;
375     // End of variables declaration                   
376     // </editor-fold>
377 }
378 
______________________________________________________________
The Adanced File Name Panel:

G:\Documents and Settings\nemo\My Documents\Programming\Java\url\src\url\FileAdvancedGUI.java

  1 // <editor-fold defaultstate="collapsed" desc=" File Info">
  2 /*
  3  * FileAdvancedGUI.java
  4  *
  5  * Created on March 1, 2006, 2:26 PM
  6  */
  7 
  8 package url;
  9 
 10 /**
 11  *
 12  * @author :  nemo
 13  * Date    :  Feb 2, 2006
 14  */
 15 // </editor-fold>
 16 
 17 public class FileAdvancedGUI extends javax.swing.JFrame {
 18     
 19     // <editor-fold defaultstate="collapsed" desc=" Variable Declaration ">
 20     private String str1;
 21     private String str2;
 22     // </editor-fold>
 23     
 24     /** Creates new form FileAdvancedGUI */
 25     public FileAdvancedGUI() {
 26         initComponents();
 27     }
 28     
 29     /** This method is called from within the constructor to
 30      * initialize the form.
 31      * WARNING: Do NOT modify this code. The content of this method is
 32      * always regenerated by the Form Editor.
 33      */
 34     
 35     // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
 36     private void initComponents() {
 37         jPanel1 = new javax.swing.JPanel();
 38         jLabel1 = new javax.swing.JLabel();
 39         jTextField1 = new javax.swing.JTextField();
 40         jLabel2 = new javax.swing.JLabel();
 41         jTextField2 = new javax.swing.JTextField();
 42         jPanel2 = new javax.swing.JPanel();
 43         jButton1 = new javax.swing.JButton();
 44         jButton2 = new javax.swing.JButton();
 45 
 46         setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
 47         setTitle("Advanced File Option");
 48         setResizable(false);
 49         jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Advanced File Options", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12)));
 50         jLabel1.setText("First Part: ");
 51 
 52         jLabel2.setText("End Part: ");
 53 
 54         org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
 55         jPanel1.setLayout(jPanel1Layout);
 56         jPanel1Layout.setHorizontalGroup(
 57             jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 58             .add(jPanel1Layout.createSequentialGroup()
 59                 .addContainerGap()
 60                 .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 61                     .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel2)
 62                     .add(org.jdesktop.layout.GroupLayout.TRAILING, jLabel1))
 63                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 64                 .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 65                     .add(jTextField2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE)
 66                     .add(jTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE))
 67                 .addContainerGap())
 68         );
 69         jPanel1Layout.setVerticalGroup(
 70             jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
 71             .add(jPanel1Layout.createSequentialGroup()
 72                 .addContainerGap()
 73                 .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 74                     .add(jLabel1)
 75                     .add(jTextField1))
 76                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
 77                 .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
 78                     .add(jLabel2)
 79                     .add(jTextField2))
 80                 .addContainerGap())
 81         );
 82 
 83         jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Navigation", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12)));
 84         jButton1.setText("OK");
 85         jButton1.addActionListener(new java.awt.event.ActionListener() {
 86             public void actionPerformed(java.awt.event.ActionEvent evt) {
 87                 jButton1ActionPerformed(evt);
 88             }
 89         });
 90 
 91         jButton2.setText("Cancel");
 92         jButton2.addActionListener(new java.awt.event.ActionListener() {
 93             public void actionPerformed(java.awt.event.ActionEvent evt) {
 94                 jButton2ActionPerformed(evt);
 95             }
 96         });
 97 
 98         org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
 99         jPanel2.setLayout(jPanel2Layout);
100         jPanel2Layout.setHorizontalGroup(
101             jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
102             .add(jPanel2Layout.createSequentialGroup()
103                 .addContainerGap(52, Short.MAX_VALUE)
104                 .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
105                     .add(jButton2)
106                     .add(jButton1))
107                 .add(57, 57, 57))
108         );
109 
110         jPanel2Layout.linkSize(new java.awt.Component[] {jButton1, jButton2}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
111 
112         jPanel2Layout.setVerticalGroup(
113             jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
114             .add(jPanel2Layout.createSequentialGroup()
115                 .addContainerGap()
116                 .add(jButton1)
117                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
118                 .add(jButton2)
119                 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
120         );
121 
122         jPanel2Layout.linkSize(new java.awt.Component[] {jButton1, jButton2}, org.jdesktop.layout.GroupLayout.VERTICAL);
123 
124         org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
125         getContentPane().setLayout(layout);
126         layout.setHorizontalGroup(
127             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
128             .add(layout.createSequentialGroup()
129                 .addContainerGap()
130                 .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
131                 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 25, Short.MAX_VALUE)
132                 .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
133                 .addContainerGap())
134         );
135         layout.setVerticalGroup(
136             layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
137             .add(layout.createSequentialGroup()
138                 .addContainerGap()
139                 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
140                     .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
141                     .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
142                 .addContainerGap())
143         );
144 
145         layout.linkSize(new java.awt.Component[] {jPanel1, jPanel2}, org.jdesktop.layout.GroupLayout.VERTICAL);
146 
147         pack();
148     }// </editor-fold>
149 
150     // <editor-fold defaultstate="collapsed" desc=" Action Buttons Performed ">
151     private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
152 // TODO add your handling code here:
153         this.str1 = this.jTextField1.getText();
154         this.str2 = this.jTextField2.getText();
155         urlGUI.FileNamestr1 = str1;
156         urlGUI.FileNamestr2 = str2;
157         urlGUI.FileNameflag = true;
158         this.setVisible(false);
159     }
160 
161     private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
162 // TODO add your handling code here:
163         
164         this.setVisible(false);
165     }                                        
166     // </editor-fold>
167     
168     /**
169      * @param args the command line arguments
170      */
171     public static void main(String args[]) {
172         java.awt.EventQueue.invokeLater(new Runnable() {
173             public void run() {
174                 new FileAdvancedGUI().setVisible(true);
175             }
176         });
177     }
178     
179     // Variables declaration - do not modify
180     private javax.swing.JButton jButton1;
181     private javax.swing.JButton jButton2;
182     private javax.swing.JLabel jLabel1;
183     private javax.swing.JLabel jLabel2;
184     private javax.swing.JPanel jPanel1;
185     private javax.swing.JPanel jPanel2;
186     private javax.swing.JTextField jTextField1;
187     private javax.swing.JTextField jTextField2;
188     // End of variables declaration
189     
190 }
191 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: