Results 1 to 7 of 7

Thread: Java Swing GUI not showing?

  1. #1
    Join Date
    May 2007
    Beans
    6

    Java Swing GUI not showing?

    Hi,

    I have being programming in Java for a couple of years but have just moved to Ubuntu (7.04). I am trying to launch a swing GUI I have created but the GUI doesn't show (see screenshot)



    I have tried to recompile using suns 1.5 JDK using Eclipse & Netbeans but the GUI still doesnt show! Anyone any ideas? I think it might be a GNOME problem. I have searched all over but can't find any fix.

    PS - the GUI runs fine under Solaris, Win32, & Mac OS X

    Thanks for any tips

  2. #2
    Join Date
    Jun 2006
    Location
    /Earth/Asia/Vietnam
    Beans
    211
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Java Swing GUI not showing?

    That problem must be on your side, since my Java Swing works just fine here. Please make sure that you compiled the code and/or Eclipse running with Sun Java, not GCJ. If you're not sure what to do, just run sudo update-java-alternatives -s sun_java_version_you_installed (i.e in my case, I'd issue this command:
    Code:
    sudo update-java-alternatives -s java-1.5.0-sun
    G'luck
    P/S: If this still doesnt help, you could, if possible, post your code up here, so we can test for you.
    .:.:.[)[@[)|2.:.:.
    "Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side-effect." -- Linus Torvald.

  3. #3
    Join Date
    May 2007
    Beans
    6

    Re: Java Swing GUI not showing?

    Thanks a lot. I have tried that earlier today & as you suggested I have been compiling & running with suns JDK (1.5). I also tried 1.6 but no joy. The source code is here:

    http://meteorjsms.googlepages.com/src.zip

    The main method is in com.googlepages.meteorjsms.gui.MeteorJSMSGUI.java
    The GUI should look something like this-


    Thanks.
    Last edited by fbradyirl; May 18th, 2007 at 07:56 PM. Reason: Add an image

  4. #4
    Join Date
    Sep 2006
    Beans
    30

    Re: Java Swing GUI not showing?

    I haven't looked at the source code just yet, but make sure you don't have Compiz or Beryl running. Some Java applications which use the Swing API (If I remember correctly) have trouble displaying.

  5. #5
    Join Date
    May 2007
    Beans
    6

    Re: Java Swing GUI not showing?

    Quote Originally Posted by Vert View Post
    I haven't looked at the source code just yet, but make sure you don't have Compiz or Beryl running. Some Java applications which use the Swing API (If I remember correctly) have trouble displaying.
    Yes that is probably it I hadn't thought of that. I have 'Desktop Effects' enabled in preferences. Is there any workaround for this yet? Thanks.

  6. #6
    Join Date
    Jul 2005
    Location
    Richmond, VA, USA
    Beans
    Hidden!
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Java Swing GUI not showing?

    Quote Originally Posted by fbradyirl View Post
    Yes that is probably it I hadn't thought of that. I have 'Desktop Effects' enabled in preferences. Is there any workaround for this yet? Thanks.
    Yes there is, check this thread:

    http://ubuntuforums.org/showthread.php?t=362821

    Which shows the fix being to add:

    Code:
    export AWT_TOOLKIT="MToolkit"
    to the end of the file /etc/profile

  7. #7
    Join Date
    May 2007
    Beans
    6

    Re: Java Swing GUI not showing?

    Quote Originally Posted by srt4play View Post
    Yes there is, check this thread:

    http://ubuntuforums.org/showthread.php?t=362821

    Which shows the fix being to add:

    Code:
    export AWT_TOOLKIT="MToolkit"
    to the end of the file /etc/profile
    Thanks a lot. I have been searching for days for this. I will try this out on Monday when I get back into work!!
    Cheers.

Bookmarks

Posting Permissions

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