Slashdot Mirror


New Desktop Features Of Next Java

bonch writes "Sun has posted the new desktop features of the next Java, codename Mustang. Improvements to Swing look and feel, OpenGL 2D renderer performance, AWT features such as the ability to add a tray/panel icon, and improved deployment capabilities."

51 of 283 comments (clear)

  1. It's worth noting... by AKAImBatman · · Score: 5, Interesting

    ...that mustang is also the first Java version to be developed under an Open Source type model. The CVS is open to guests over on http://www.java.net, thus allowing for immediate feedback and bugfixes. It has been a real boon for the gaming community, as they've been able to direct several key performance features.

  2. The look and feel of Swing. by chkorn · · Score: 3, Interesting

    Yeah! This is really something that should be made better.
    Always when I use some Swing based applications I'm remembered that the times of ugly GUI's aren't over yet.

    --
    chris
    1. Re:The look and feel of Swing. by TiMac · · Score: 3, Interesting
      They are improving the Windows and GTK Look and Feel...but I'm hoping also that either Sun or Apple tackle the Mac OS X look and feel of Java apps.

      Sure, you can code Cocoa apps in Java and use Java in those ways...but pure Java executables programmed in Swing still lack the complete purity of Mac OS X. Apple ships tools in the Developer Tools to improve Java (like Jar Bundler) but the UI still isn't perfect.

      --

    2. Re:The look and feel of Swing. by MassacrE · · Score: 5, Insightful

      Personally, I'd be happier if they completely dropped swing support on the Mac ,or at least removed aqua L&F.

      There is a proliferation of really horrid java applications on the Mac because people don't understand that you cannot WORA and have GUI make sense. Users of different operating systems have different needs and expectations, even when they are equivalent 'types' of users with relatively equal computer experience.

    3. Re:The look and feel of Swing. by lrucker · · Score: 2, Insightful
      Using the native LnF is not a problem, provided you let the layout manager do its job. The worst thing you can do is hardcode layout values. As for menu items and such, you can specify platform in your resources, and there's a way to make Swing apps put Swing menu items into the real Mac menu - somewhere on Apple there's a tech note that goes into more details on all these things.

      You can use the MacMetrics Metal theme I wrote to get an approximation of how things will be laid out under the MacL&F

  3. alright.... by HTL2001 · · Score: 3, Funny

    Who spilled the java in my Mustang??!

    --
    By reading this, you have given me brief control of your mind.
  4. Dear jFirstPostBot by Letter · · Score: 5, Funny
    Dear jFirstPostBot,

    You would have succeeded, if only you had used the speedy next version of Java, codenamed Mustang.

    Letter

  5. SubPixel Rendering by aCapitalist · · Score: 5, Interesting

    It looks like they've finally addressed this issue, but I think Sun is a little late.

    Personally, I can deal with non-native look-n-feel, but when the fonts look like something circa 1988 on an Amiga, how can anyone take Swing seriously.

    I never understood why they couldn't use platform specific code for fonts, and if not possible then go into fallback mode and paint everything themselves.

    Swing has been a disaster. I believe it was the OTI guys (who now work on Eclipse and SWT) that told Sun not to go the route of "give me a handle to a brush and we'll paint everything ourselves", but some other group won that debate.

    And thank god for .NET/Mono being around to give Sun a little kick in the rear to get moving on things.

    1. Re:SubPixel Rendering by bnenning · · Score: 3, Interesting

      Swing has been a disaster. I believe it was the OTI guys (who now work on Eclipse and SWT) that told Sun not to go the route of "give me a handle to a brush and we'll paint everything ourselves", but some other group won that debate.

      Indeed. The implementation of AWT sucked, but it at least had the right idea: the host OS has facilities for drawing interface elements, so use them rather than reinventing the wheel. Apple's Swing L&F is halfway decent because they use native APIs to draw widgets, and according to the article Sun is now doing the same thing for Windows and Linux. Desktop Java would be in a much better state if they hadn't gotten sidetracked for years trying to make apps on every OS look identically bad.

      --
      How to solve most of our problems: 1.Lots of nuclear plants. 2.Cure aging.
    2. Re:SubPixel Rendering by shutdown+-p+now · · Score: 2, Interesting
      I believe it was the OTI guys (who now work on Eclipse and SWT) that told Sun not to go the route of "give me a handle to a brush and we'll paint everything ourselves", but some other group won that debate.
      Strictly speaking, this approach can work very well. That's exactly how Qt handles things - and it's damn hard to tell a Qt app on Windows from a native one (not sure how things are on Mac, but judging by the screenshots, it's fine there as well).
  6. What I'd like to see is by ImaLamer · · Score: 5, Funny

    Screenshots!

    A story about desktops carry no weight with me unless there is pretty pictures.

  7. Disclaimer on the url "we would LIKE to" have in.. by Assmasher · · Score: 2, Interesting

    ...the next version.

    Not quite the same thing as "this is in the next version."

    --
    Loading...
  8. Re:Additional items by lawpoop · · Score: 2, Interesting

    I don't get it. If sun was responsible for 64-bit computers being commonplace, how come Java doesn't support 64 bits?

    --
    Computers are useless. They can only give you answers.
    -- Pablo Picasso
  9. Re:Java Desktop by Lysol · · Score: 3, Insightful

    First off, no one said it's what we need. And regardless if you or I feel there might be no need for it (I personally use it daily), there are plenty of shops out there that do.

    And second, they're addressing a significant issue with Swing which is its pokyness. This is going head on with SWT , a 'feature' that Eclipse people have enjoyed for sometime. This also signifies Sun throwing in the towel on their whole Swing widget abstraction, abstraction, abstraction mantra in favor of using the native OS rendering widget facilities. This has been a major Java gripe for some time; why can't my Windows Java app look like a Windows app and why does it have to be do damned slow?!

    Should be interesting to see how these features/additions play out. Also, looks like Swing apps are finally getting native aa font support. This will please many as the text rendering in Java apps is still in the Windwos 2k/GTK 1.x days..

  10. Re:how about by comwiz56 · · Score: 2, Informative

    You don't have to use a layout manager. You can easily call setLayoutManager(null), and then use coords to place everything in the frame.

  11. Localizability by tepples · · Score: 2, Insightful

    but I like to position the elements where I want them, and not how some layout manager feeld they will will go best.

    Thing is that "some layout manager" will know about the different conventions used for different human languages when it comes time to localize your software. Pixel layout is dead because different languages use different numbers of letters to spell the same thing. And in Israel and the Arab world, text in the local languages reads from right to left.

  12. Re:Java Desktop by REggert · · Score: 5, Informative

    I'm no Java fanboi, but these are some the classical advantages of Java over other languages:

    • The compiled code is completely (well, almost) platform-independent, eliminating the need to port or even recompile code when moving between platforms. This can be especially handy for GUI's, as it gets around the problem of different windowing systems having their own mutually exclusive API's. Write and compile your interface once, and it can be run on any machine that has a JVM installed, whether it be Windows, Mac, XFree86, or whatever.
    • It's ALMOST as fast (and in many cases just as fast) as C code. Additionally, it compiles much faster than C, though C binaries make up for it with substantially shorter load times (Java has been improving in this regard recently, however).
    • The language is designed to avoid some of the "problems" in C and C++.
    • Java provides free (in terms of effort) garbage collection, which (usually) prevents memory leaks.
    • Java applets can run in web browser. This allows websites to provide visitors to their sites with custom mini-applications to provide various functionality or visual effects. One of the major benefits to this (especially when combined with the use of application servers) is that a large organization can install all their software in a central place and allow its users to access it from any machine just by using their web browsers.

    There are others, but these are the ones that immediately come to mind for me.

    I'm a C++ coder myself, but I do appreciate Java's value for certain situations.

    --

    cp /dev/zero ~/signature.txt

  13. Re:JAVA - the little train that could by hanshotfirst · · Score: 4, Interesting

    And how long did it take BASIC to get this?
    When is it coming out for FORTRAN and COBOL?
    10 years is still young as far as languages go.

    --
    Why, oh why, didn't I take the Blue Pill?
  14. Re:Additional items by SnprBoB86 · · Score: 4, Informative

    You can allocate as much memory as you like using the right java command line flags:

    http://developer.apple.com/documentation/Java/Re fe rence/Java14VMOptions/VM_Options/chapter_1_section _4.html

    --
    http://brandonbloom.name
  15. Re:Sun actually listening to developers-java.net by AKAImBatman · · Score: 4, Informative

    java.com is the user's site that plays up stupid mobile games and the like.

    java.net is the "Network of developers" who are creating useful (and useless) software.

  16. Re:Additional items by nganju · · Score: 2, Informative


    Java already has support for 64-bit Athlon on Linux.

    They also have a release candidate for Windows 64 here:
    http://java.sun.com/j2se/1.5.0/download.jsp

    Both of these versions allow the allocation of much more memory to Java apps. The old roughly 2 gig limit was a limitation of 32-bit operating systems, not of the java vm. Give it a shot on the 64-bit VMs with
    java -Xmx3000m MyApplication
    it should run fine (assuming you have >=3 gig of memory).

    --
    There are 2 kinds of people in this world. Those that can keep their train of thought,
  17. 64-bit support is done! by Wesley+Felter · · Score: 4, Informative

    64-bit Java VMs have been available for SPARC64, PPC64, and AMD64 for ages.

  18. Re:SWT by mark-t · · Score: 4, Insightful
    If you didn't RTA, you may not have noticed that the *FIRST* thing on their list of improvements was improving the native look and feel for both the windows and gtk platforms.

    Also, Swing integrates well into the rest of Java, including Java2D, where SWT does not.

  19. From the article... by kjeldor · · Score: 5, Funny

    Where possible, we will add pointers

    Wow, the beginning of that sentence sure scared the hell out of me. In my opinion, asterisks should be for multiplication only.

  20. Java & Longhorn by slasho81 · · Score: 2, Insightful

    I'm very excited with all the improvments Java is going through, but I'd hate to see it all being completely missed by the general public and web application developers if Microsoft won't include the JRE and Java Plug-in in Longhorn.

    Anyone knows what going on with this issue?

  21. Re:SWT by omicronish · · Score: 2, Insightful

    If you didn't RTA, you may not have noticed that the *FIRST* thing on their list of improvements was improving the native look and feel for both the windows and gtk platforms.

    But how close is it to the native Windows look? I've found that whenever someone does custom widgets that tries to emulate the native look, there's always something missing or slightly different that produces a disconcerting GUI feeling. Maybe a lot of people don't notice, but I'd rather it look completely different than almost the same but with quirks. Eclipse is good in this manner. It looks very nice and fits right in with other Windows apps.

  22. Re:64-bit pointers by AKAImBatman · · Score: 4, Informative

    Exactly. So why is Sun dragging its feet on porting its virtual machine for the Java language to the AMD64 platform?

    What are you talking about?!? Go to http://java.sun.com and click on "J2SE 5.0". Then click on "JDK 5.0 Update 2" and accept the license agreement. Right there are four packages for AMD64. (Two for Linux, two for Solaris.)

    Stop spreading FUD.

  23. Re:Whats the point now by nogginthenog · · Score: 2, Informative

    But I can count the number of .net desktop apps I know on 1 finger!

  24. Re:Additional items by CynicTheHedgehog · · Score: 2, Informative

    All three items are possible, but entirely dependent on the virtual machine implementation.

    1) In the current Sun JVM you can allocate more memory space with the -Xms and -Xmx switches (min and max heap size, respectively)

    2) I believe that the Solaris VM has 64-bit support. 64-bit support for AMD/G5 could be forthcoming, but they are still relatively new. Than, and you can't really expect Sun develop optimized JVMs for competitors.

    3) As for hardware specific calls and optimizations, I'm sure that if AMD, Apple, IBM, and/or Intel wanted to invest in developing their own custom JVMs with those optimizations they would be welcome. Again, it's not really in Sun's best interest to develop VMs optimized for their competitors' hardware. Apple has their on JVM, but I'm not sure what kind of effort they have put into hardware optimization.

    3) Java is not C or assembly language. If your performance requirements are critical to the point necessitating direct hardware calls then I can pretty much guarantee that Java is not the appropriate platform for you application.

    - Jesse

  25. Re:Java Desktop by DarkSkiesAhead · · Score: 5, Insightful


    Simple really-- some programmers are lazy. They can't be bothered with optimizing their code for individual platforms ... as soon as I find out something's written in Java I can immediately ignore it

    Sorry, but that's a pretty ignorant attitude. Judging an application soley on being java-based is a poor method. Rather, you should ask if the developing language is appropriate for the task. If someone told me they wrote a graphically intense FPS in java I would be suspicious. But, if the app only needs to be light and portable java may be a good choice. It allows for very easy control of how the application looks on multiple operating systems. A good example of a nice-looking java app with no speed issues is Limewire. It runs quickly, works well and can be updated more efficiently than if they had used a graphical toolkit for python or C. Not that anything is wrong with chosing python or C either. It entirely depends on your application requirements and development resources. Brushing off all apps written for the JVM (or any development kit) will cause you to miss out on a good app sometime.

  26. Re:Additional items by iwadasn · · Score: 4, Insightful


    It does, on linux and Solaris, I believe. No 64 bits on windows, perhaps because windows doesn't support it?

  27. As someone who develops Java desktop apps... by ChiralSoftware · · Score: 4, Insightful
    I would like to see three things:

    First, it seems like KDE/Qt has more momentum than GTK on the desktop. Qt apps look better and are more integrated with eachother. Suse is the dominant desktop Linux distro and Suse is KDE-oriented. I'm glad that Java is going to be using native GTK for rendering, but what I would really like to see is native Qt. Maybe they could create some kind of interface to make it easier to plug in different rendering systems? Maybe they could open source Java and let the community take care of it? Maybe they don't care because desktop Linux is only about 5% of the market anyway? But still, it's something I would like to see.

    The second thing they need is a "SwingLite", or some easier way to do common things. For example, it is very common to need a text field that allows the user to enter a number, but not text. Should be easy, right? This is the code I have to use to do it:

    formattedTextField.setFormatterFactory(new DefaultFormatterFactory(new NumberFormatter(NumberFormat.getIntegerInstance()) ));
    That's just wrong. I should be able to say:
    formattedTextField.setFormat("d+");
    or maybe:
    formattedTextField.setFormat(FormattedTextField.IN TEGER_ONLY);
    The above example, involving two different factory classes to just get the field to accept integers only, puts a high burden of knowledge on the programmer, and Swing is full of stuff like that. It's great that the power is there because I can write my own hierarchy of text formatting factories and objects that enforces correctly-entered Sandhi rules, but that doesn't come up very often, and what does come up very often is having to enter a plain old number, date, currency value, that kind of thing. And I'm just using this one example, but this kind of over-design is all over the place in Swing.

    The final problem that they have is putting emphasis on plugable look and feel. Application developers shouldn't get to decide the look and feel of their apps. That should be determined by the desktop environment. Pluggable look and feel is not a feature; it is a bug. It should be deprecated and removed.

    ----------
    Educational software

    1. Re:As someone who develops Java desktop apps... by aCapitalist · · Score: 4, Informative

      Despite the technical superiorty of Qt Sun will not use it to draw widgets because (A) Sun uses Gnome for its desktop and (B) the dual-licensing scheme of Qt.

      And I don't know where you get this information about KDE/Qt having more momentum. If anything, it's the other way around. Sun, RedHat, and Novell (the 3 biggest Linux shops) are all going with Gnome. Yeah, I know about Suse and KDE, but if you look at the resources being invested it's all Gnome/Mono.

      Until Trolltech gets bought out, the license issues surrounding Qt are unlikely to go away.

    2. Re:As someone who develops Java desktop apps... by Hulfs · · Score: 4, Informative
      What's wrong with doing:
      new JFormattedTextField(NumberFormat.getIntegerInstanc e());
      Seems to work fine for me. Uses the default locale's integer formatter. See Sun's Tutorial
  28. Seems like they are really improving things by FedeTXF · · Score: 4, Interesting

    I use many java desktop apps in my day to day tasks on my linux desktop. There is no better way to connect to multiple databases than Squirrel , No better way to code in Java than NetBeans and no better editor than JEdit

    I think Java 5 already has great desktop features like shared class data, and 2D acceleration for 2D acelerated hardware (which I don't have yet!).

  29. Re:Additional items by jkroll · · Score: 2, Informative

    Says the max memory allocatable is 2048M? 2 gigs is a lot of memory, but I'm not sure this is as much memory as I want though.

    This is a JVM issue, not a language issue. There is nothing in the language spec limiting memory support to 2GB anymore than Windows C language programs are limited to 2GB of memory.

    There is no real reason why Sun (or any other JVM provider) couldn't and doesn't provide a 64 bit JVM that can access more than 4GB of memory.

    Having said that, it would be nice if there was a command line option on startup that could set the JVM memory limit to some percentage of the physical RAM available on the system (i.e. something like java -Xmxp 50 -- would start the JVM up with a memory limit of 50% of the physical ram on the machine). Today you would need to write an OS specific script/wrapper program to determine the available memory and then launch the JVM.

  30. Re:Additional items by Decaff · · Score: 4, Informative

    I don't get it. If sun was responsible for 64-bit computers being commonplace, how come Java doesn't support 64 bits?

    Who says it doesn't?

    Go to javasoft.com, and check the downloads. You can get Java for 64-bit Linux on AMD and 64-bit Solaris on Sparc and AMD.

  31. Re:Java Desktop by MemoryDragon · · Score: 3, Interesting

    Actually Sun is not throwing in the towel, Swing has done an interesting approach no other Widget set has done so far. They basically went the way, of rendering the widgets still in software, but the underlying graphics layer is hardware accelerated if possible and the rendering data for the skins is directly parsed from the underlying OS skinning engine if present.

    And Swing has gotten much faster that way. Swing has been already more than usable in 1.4 and I recently checked the latest 1.6/6.0 builds, and all I can say is wohaaa... The guy in 1.6 at least on Windows is very snappy. I have had running Firefox and SwingSet2 running side by side and SwingSet2 blew firefox away rendering speedwise.

  32. Re:Additional items by albrecht · · Score: 2, Informative

    bea now has a 64-bit windows itanium jrockit 1.5.0 now as well. HP has recently added 64-bit hpux pa-risc and itanium too.

    --
    Jonathan Albrecht
  33. I'd grind up netbeans by FerretFrottage · · Score: 2, Insightful

    and suggest Eclipse or IntelliJ as a better java IDE.

    --
    "Look Lois, the two symbols of the Republican Party: an elephant, and a fat white guy who is threatened by change."
  34. Re:Sounds great...couple more things... by mccalli · · Score: 2, Interesting
    Basically you end up having two different versions of your application, one that works with WS and one that works as a native application, which stinks from a QA perspective

    Why? I'm genuinely curious here - I also use WebStart, and I don't need to end up with two versions of the code. Be interested to hear what's restricting you.

    Cheers,
    Ian

  35. What I want by ToasterofDOOM · · Score: 3, Interesting

    Is stability, security, and more speed. OOo 2 beta is SLOW and most issues i have with it are Java related in some way.

    --
    I am Spartacus
  36. Re:Additional items by Glock27 · · Score: 2
    Hard to see how to improve that without destroying run-anywhere.

    Not true. Why would you think that?

    You'd have to stick with 32-bit integers, or you wouldn't get the same behaviour on two different platforms.

    You don't know about "long"?

    I guess the VM could use 64-bit pointers internally, but as you can't access memory directly in Java I don't know how the programmer would ever be able to tell.

    The programmer would be able to tell when the allocation of more than 4 GB worth of objects happened without incident. :-)

    If you really want to limit yourself to a single platform, use JNI to call C code that uses your hardware-specific instructions. But if you're going to do that, why not just use C++ in the first place?

    Because C++ is rather broken, and people would rather use a saner language? For instance, gcj and CNI provide a lightweight approach that seems superior to JNI in many situations.

    C++ really needs to be replaced, and Java seems the logical candidate to do it. Java needs further improvements and extensibility, but C++ was around a *long* time before it began to approach actual usability.

    By the way, 64-bit VMs do already exist...

    --
    Galileo: "The Earth revolves around the Sun!"
    Score: -1 100% Flamebait
  37. Re:how about by Call+Me+Black+Cloud · · Score: 3, Insightful


    "Dear China,

    I am inexperienced with the Chinese language. I am having difficulty learning it because I find it ridiculously complicated. Please simplify it.

    Signed,

    VolciMaster"

    As for the layout managers, you just need practice with them. My suggestion is to stick with BorderLayout, FlowLayout, and BoxLayout (with some widgets from the Box class). You can easily nest panels using those layout managers to get what you want, 99% of the time.

    Do you know what frustrates me about Windows development (using C++ Builder)? Absolute positioning. I place things where I want them, run the app, resize the window, and nothing moves! Only the window gets bigger. Once you get the hang of layout managers you'll see how easy they are to use and how much nicer your UIs will be.

  38. Re:SWT by csnydermvpsoft · · Score: 2

    What about Firefox? With the Qute theme, it's pretty damn hard to tell that it's not a native app.

    Firefox is a native app.

  39. Re:Additional items by ShamanDave · · Score: 2, Funny

    The feature I'd most like to see? Availability of the real Sun JRE through Microsoft Windows Update. OK. So it's not realistic, but it would make me happy.

  40. No plug-in on AMD64 by Anonymous Coward · · Score: 2, Informative

    The AMD64 editions still does not provide a browser plug-in. Luckily, there is Blackdown.

  41. Re:SWT by anti-trojan · · Score: 2, Informative

    The poster means that it is not using native OS widgets but depends on its own XUL controls.

  42. Viva Java! by prophecyslides · · Score: 2, Insightful

    About time they started thinking about the desktop. Java rules the server, why not the client?

  43. Re:Additional items by iksrazal_br · · Score: 2, Informative
    "You can allocate as much memory as you like using the right java command line flags"

    Try this on a 16 gigs of memory Solaris 10K:

    byte[] b = new byte[3000L * 1000L * 1000L];

    Seen this question today:

    http://groups.google.com.br/groups?hl=pt-BR&lr=&th readm=pan.2005.04.21.09.43.29.859952%40fffffffffff fff.com&rnum=11&prev=/groups%3Fq%3Dmemory%2B2005%2 6hl%3Dpt-BR%26lr%3D%26group%3Dcomp.lang.java.progr ammer%26start%3D10%26sa%3DN

    People doing biometrics apparently are trying to.

    iksrazal