1 26 package org.objectweb.openccm.explorer.menu; 27 28 29 import javax.swing.JPanel ; 30 import javax.swing.Box ; 31 import java.io.File ; 32 33 40 public class FileChooserPanel extends JPanel { 41 42 protected LabelBox labelBox_ = null; 43 44 protected FileChooserBox fileChooserBox_ = null; 45 46 public FileChooserPanel(String nameFieldLabel, String nameBrowserLabel, int fileFilterType) { 47 Box box = Box.createVerticalBox(); 48 box.add(Box.createVerticalGlue()); 49 labelBox_ = new LabelBox(nameFieldLabel); 50 box.add(labelBox_); 51 box.add(Box.createVerticalStrut(10)); 52 fileChooserBox_ = new FileChooserBox(nameBrowserLabel, fileFilterType); 53 box.add(fileChooserBox_); 54 box.add(Box.createVerticalGlue()); 55 add(box); 56 } 57 58 59 public String getLabel() { 60 return labelBox_.getLabel(); 61 } 62 63 64 public File getFile() { 65 return fileChooserBox_.getFile(); 66 } 67 68 } | Popular Tags |