Results 1 to 3 of 3
  1. #1
    ashin is offline Member
    Join Date
    Nov 2008
    Posts
    71
    Rep Power
    0

    Default my awt is not available

    im using the java.awt. desktop but it says that it is not available .. so where can i find it? thanks
    :cool:

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    Quote Originally Posted by ashin View Post
    im using the java.awt. desktop but it says that it is not available .. so where can i find it? thanks
    Can you elaborate? Perhaps post some code and an actual error statement. Also, how does this question relate to SWT or JFace (which is the forum that this question has been posted in)? Should I move this question to the AWT forum?

  3. #3
    ashin is offline Member
    Join Date
    Nov 2008
    Posts
    71
    Rep Power
    0

    Default

    no .. u dont need to move it ... the reason why i posted it in swt because im using the swt embedding awt.. actually my program is, i need to open a folder when i hit the button... this folder contains all my files.. its like open you my documents in windows... unfortunately the java.awt.desktop class is not available.. here is my code
    Java Code:
    package webportalcms;
    
    import java.io.File;
    import java.io.IOException;
    import java.awt.Desktop;
    
    import org.eclipse.swt.widgets.Display;
    
    //Can be open the uploaded files
    public class FilesFolder {
    
    	public FilesFolder(Display display) throws IOException {
    	      //File path = new File("bin/files"); // path to the directory to be opened
    		File path = new File("bin/files/");
    	  		Desktop desktop = null;
    	  		if (Desktop.isDesktopSupported()) {
    	  			desktop = Desktop.getDesktop();
    	  		}
    	  		try {
    	  			desktop.open(path);
    	  			
    	  		} catch (IOException e) {
    	  		}
    
    	}
    
    }
    :cool:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •