[Swingwt-developers] JFileChooser
Status: Beta
Brought to you by:
bobintetley
From: <ser...@gm...> - 2005-09-16 20:20:32
|
Hello,=20 I'm having a problem when I try to call the method showDirectorySelectDialog in the JFileChooser class. well, i have to give two parameters. this is the code:=20 public String getDir(){ =09JFileChooser jfc =3D new JFileChooser(); =09JPanel p =3D new JPanel();=09 =09jfc.showDirectorySelectDialog(p,"Chooser your site directory,pleased"); =09return "fsd"; =09} and this is the error : Exception in thread "main" java.lang.NullPointerException =09at swingwtx.swing.JFileChooser.showDirectorySelectDialog(JFileChooser.ja= va:512) =09at hotdebye.modules.FileView.actions.ChooseDirAction.getDir(ChooseDirAct= ion.java:48) =09at hotdebye.modules.FileView.FileViewer.<init>(FileViewer.java:30) =09at hotdebye.HotDebye.<init>(HotDebye.java:19) =09at hotdebye.HotDebye.main(HotDebye.java:48) looking the JFileChooser source, I supposed that the method getSWTPeer().getShell() is returning null. can someone help me ? |