Re: [Java-gnome-developer] Problems with FileChooserWidget
Brought to you by:
afcowie
From: pancake <pa...@ph...> - 2005-06-04 21:58:39
|
you can also take a look on the gdvb source code, in the file Gdvb.java -> = addLocalVideos() VBox addLocalVideos() { VBox vb =3D new VBox(false,5); vb.setBorderWidth(5); fcw=3Dnew FileChooserWidget(FileChooserAction.ACTION_OPEN); String videos =3D Gdvb.conf.getProperty("dir_videos"); try{ System.out.println("VIDEODIR: "+videos); if (videos!=3Dnull) { fcw.setCurrentFolder(videos); // XXX java-gnome BUG <- this is fixed in CVS // fcw.addShortcutFolder("/"); //videos); } } catch(Exception e) { System.out.println(e); } FileFilter mediaFilter =3D new FileFilter(); mediaFilter.setName("video"); mediaFilter.addMimeType("video/mpeg"); mediaFilter.addMimeType("video/x-msvideo"); mediaFilter.addMimeType("video/quicktime"); fcw.addFilter(mediaFilter); FileFilter allFilter =3D new FileFilter(); allFilter.setName("all filetypes"); allFilter.addPattern("*"); fcw.addFilter(allFilter); vb.add(fcw); HButtonBox hbb =3D new HButtonBox(); hbb.setSpacing(5); hbb.setLayout(ButtonBoxStyle.END); Button stop =3D new Button(GtkStockItem.MEDIA_STOP); stop.addListener((ButtonListener)this); hbb.add( stop ); Button play =3D new Button(GtkStockItem.MEDIA_PLAY); play.addListener((ButtonListener)this); hbb.add( play ); vb.packEnd(hbb,false,false,5); return vb; } On Sat, 4 Jun 2005 17:44:31 -0300 (ART) Joao Victor <jvi...@ya...> wrote: > --- Igor Foox <if...@re...> escreveu: >=20 > > Hi everyone, > >=20 > > I'm a fairly new user to java-gnome, so please bear with me. >=20 > Hi Igor, welcome! >=20 > >=20 > > I seem to have some trouble with the FileChooserWidget. I first tried to > > use it in a semi-complex window, and got the following error (and no > > widget): >=20 > Hmm, just so i get it right: do you want to just show a filechooser, or d= o you want to embbed it > in another window? To just show it, this is the code i used in an app: >=20 > ---- > FileChooserDialog dialog =3D new FileChooserDialog("Select a picture", th= is, > FileChooserAction.ACTION_OPEN); > dialog.addButton("gtk-cancel", 0); > dialog.addButton("gtk-ok", 1); > dialog.setCurrentFolder(System.getProperty("user.home")); > int result =3D dialog.run(); >=20 > if (result =3D=3D 1) { > //.... > } > ---- >=20 > Now, if you want to embbed it, i haven't tried doing it yet (will try), b= ut take a look at GDVB, > it seems to have a nice customized FileChooser, from what can be seen in = this screenshot: > http://news.nopcode.org/gdvb02.png >=20 > Cheers, > J.V. >=20 >=20 >=20 > =09 > =09 > =09 > ____________________________________________________ > Yahoo! Mail, cada vez melhor: agora com 1GB de espa=E7o gr=E1tis! http://= mail.yahoo.com.br >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. How far can you sho= tput > a projector? How fast can you ride your desk chair down the office luge t= rack? > If you want to score the big prize, get to know the little guy. =20 > Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=3D20 > _______________________________________________ > java-gnome-developer mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-gnome-developer |