Java GUI problem on Leopard

Discussion in 'Mac Programming' started by vikasu, Jan 7, 2008.

  1. vikasu macrumors newbie

    Joined:
    Nov 6, 2007
    #1
    Hi All,

    I hd created an application containing GUI controls of X types on Tiger (with JDK 1.5.0_06) using NetBeans IDE. The UI looks better, but when I ran my app. on Leopard (10.5) with JDK 1.5.0_13 the UI controls are distorted :confused:, why this is so? is that due to Java version (build no.) difference or due to Leopard UI, or due to some X reason.
    Plz reply for the same...

    Vikas
     
  2. sord macrumors 6502

    Joined:
    Jun 16, 2004
    #2
    All of the above plus Java is a bit broken in parts on Leopard :mad:
     
  3. m1ss1ontomars macrumors 6502

    Joined:
    Oct 1, 2006
    #3
    There you go; that's why. If you're programming in Java I don't think you can realistically expect your programs to always have a nice polished GUI. In fact, this thread should just be called "Java GUI problem".
     
  4. therevolution macrumors 6502

    Joined:
    May 12, 2003
    #4
    :rolleyes:

    Vikas, do you have any sample code you can post? Your problem description is kind of vague. By "X types," do you mean it's an X11 app (as opposed to Swing or SWT)?
     
  5. garethlewis2 macrumors 6502

    Joined:
    Dec 6, 2006
    #5
    Considering he used X two times in his original post, it is obvious he is using X as in a variable in math.

    And this has to be the most **** comment I have ever read.

    There you go; that's why. If you're programming in Java I don't think you can realistically expect your programs to always have a nice polished GUI. In fact, this thread should just be called "Java GUI problem".

    What a load of complete ********. That's like saying. Sorry you shouldn't use Swing, Sun are a complete bunch of ********* who can't program GUIS. If you want a GUI you should use Cocoa.

    Look at Nimbus the new Look and Feel from Java6 and also look at Filthy Rich Clients, the book that shows you how to easily produce GUI's that compete with Cocoa, including lovely animated effects using a portable library using JOGL.
     
  6. m1ss1ontomars macrumors 6502

    Joined:
    Oct 1, 2006
    #6
    Well due to the original poster's bad grammar it's hard to correctly interpret his sentences. I'm not sure X as a variable is what he meant either.

    Besides, Sun didn't even port Java to Mac OS X, so I hardly think you're interpreting my comment correctly either. Mostly because I'm joking. But you can't deny that Java apps sometimes have very real problems integrating with the OS. Nimbus looks very nice indeed, but it doesn't match the rest of Mac OS X.
     
  7. vikasu thread starter macrumors newbie

    Joined:
    Nov 6, 2007
    #7
    X means JTextField, JButton, etc. J****, now the thing is that I am restricted to use Java 5, and the UI i made looks different on Tiger and different(bad) on Leopard, now I corrected it on Leopard and than ran the app on Tiger, now it appears bad on tiger, Why UI components are repositioning???
     
  8. garethlewis2 macrumors 6502

    Joined:
    Dec 6, 2006
    #8
    If you are getting problems where JLabel and JButtons are being resized and even moved slightly, then the underlying AWT layer and Swing layer written by Apple, not the correct version by Sun is screwed. I'm surprised that more developers haven't been screaming about the supposed problems with the layout.

    BTW what layout manager are you using. If you want it to look even resonable you should be using GridBagLayout.
     
  9. jeremy.king macrumors 603

    jeremy.king

    Joined:
    Jul 23, 2002
    Location:
    Fuquay Varina, NC
    #9
    Post some code and sreenshots of your issues. It's very easy to blame the OS, but the code could also be suspect.
     
  10. therevolution macrumors 6502

    Joined:
    May 12, 2003
    #10
    I work on Java Swing apps for a living (please hold the pity remarks :p). If there were some horrible, obvious bugs that went in with Leopard, I'm pretty sure I would have noticed. Nothing so far.

    Without a more detailed description -- code, screenshots, anything -- there's not much we can do here.
     
  11. vikasu thread starter macrumors newbie

    Joined:
    Nov 6, 2007
    #11
    I hv got two docs on this issue

    http://developer.apple.com/releasenotes/Java/JavaLeopardRN/JavaLeopardRN.pdf

    Now in this apple is saying that we hv changed the Aqua L&F in Java5 for Leopard, due to this the J****s(swing) are taking more space and resizing & repositioning. Now for its solution they hv added new features in that..

    http://developer.apple.com/technotes/tn2007/tn2196.html

    In this tech note they explained evry thing about their new controls. OK, now they work fine for Leopard, but the same code creates a very bad GUI on Tiger :( , and I am restricted to use the same, becoz my some client releases hv already gone, so change in the GUI will not be acceptible, all I can do is make a new .app for Leopard...:eek:, IS THIS THE ONLY SOLUTION?????
     
  12. therevolution macrumors 6502

    Joined:
    May 12, 2003
    #12
    Still not going to show us any code? I have a hunch the problem lies there. Bad use of layout managers, for example.

    I guess you can litter your code with these:

    Code:
    if (System.getProperty("os.version").contains("10.5"))
    {
        // do Leopard stuff here
    }
    else
    {
        // do Tiger (non-Leopard, really) stuff here
    }
    
    Not sure what else to tell you.
     

Share This Page