Re: [Java-gnome-developer] Possibility to built SWING on top uf Java-GTK?
Brought to you by:
afcowie
From: Helgi H. G. <he...@bi...> - 2003-01-09 14:12:18
|
Well, the slowness of Swing is not at all what I would argue about. The only thing I find silly about Swing is that it doesn't (for now, at least) use native widgets to display windows and their content. If in Swing 1.5 they'll actually bind it to the native Gtk+ lying on whichever platform you're running, that'll be great. But simply imitating the default Gtk+ look & feel wouldn't be a solution to the problem. For example, if I change the theme of Gtk+, I would want Swing apps to use the same thing, regardless of what Java feels about it, since that functionality should be in the native widget set itself, in our case, Gtk+. Whether this'll be the case for 1.5 or not, I don't know, I couldn't tell by your words. If this is what they'll do, I'll embrace Java Swing much sooner. Furthermore, if that's the case, a specific Linux project of implementing Gtk+ in Swing (with the relevant and cross-platform Swing API and all that stuff) would be rather pointless. We wouldn't get the project in a runnable state before 1.5 anyway. If you can, please elaborate on what you meant by your words on 1.5. Do you know if they're planning on using the native, underlying Gtk+ set or are they just going to imitate it? The underlying code running Swing can be slow as hell for all I care. The greatest slowdown in Swing so far has been drawing the UI itself through whichever technology they've used so far. But like I said, the slowness isn't the point, that can be remedied later. Using the Gtk+ widget set from the underlying OS, however, would be politically a more correct way, since that would dump the performance responsibility to the underlying OS and libraries, where that responsibility belongs rightfully. Peace. Helgi Hrafn Gunnarsson On 09 Jan 2003 13:22:10 +0000 Bill Haneman <bil...@su...> wrote: > On Wed, 2003-01-08 at 22:32, Helgi Hrafn Gunnarsson wrote: > > Howdy. > > > > I must agree with the man. I've been wondering about this for quite some time, now. > > > > Recently I was finally able to get myself a Mac, and I'm running Mac OS 10.2 on it. > > Amazed as I was, it runs Swing apps like native Mac OS 10.2 apps, although the > > default (butt-ugly, pardon my French) Swing look can be used as well. > > Swing doesn't have to be slow; even some Sun VMs that do all the > rendering in Java (rather than native widgets) are pretty fast. 1.4.X > is lots lots faster than 1.3, and 1.3 was faster than 1.2's Swing > (which, it has to be said, was kind of a dog from a performance point of > view). > > All VMs have to do JNI somewhere. The issue is whether you maintain > platform portability or not; if your JNI modules are either not > available on all platforms with compliant Java VMs, or aren't always > available on your "platform" (e.g. if they are GTK+ or Win32-specific), > then you've lost the "write once run anywhere" concept of the VM. > > So I think it really does matter, this "pure Java" thing; not as a > "purity of essence" thing but from the point of view of portability. If > you don't care about portability, ok, but realize that many Java users > do. > > It would be great to optimize Swing performance on every platform with a > VM. There's no reason why this can't be done for GTK+, and as long as > the result doesn't modify the Swing APIs incompatibly or introduce new > APIs into the javax.swing or com.sun namespaces, this is even compatible > with the 'JCP' as I understand it (again, flames to /dev/null, I am a > GPL/LGPL advocate too). But any nonstandard API should be in a > different namespace. > > > I really do remember reading somewhere on java.sun.com that Swing was designed to have > > widgets that belong to all popular widget sets, and since Sun are Unix-hackers I > > would only imagine they had taken Gtk+ into account (not that Gtk+ is exactly lacking > > widgets). Mac OS X obviously has everything and I assume MFC does as well, according > > to what you just wrote. Regardless of all of this, I've never seen a widget or a tool > > in Java Swing apps that I haven't seen in any of these toolkits. > > > > I also know that Gtk+ was designed specifically with language bindings in mind, so I > > really can't believe that it's impossible or even that difficult to use native Gtk+ > > widgets instead of drawing the entire Swing thing from scratch (like the Sun VM does). > > > > This is just some rambling from me. :) I'm not good enough in Java (in fact I barely > > know the language) to do this, but I would like to participate, once I get this > > f***ing gnome-gcj thing up and running. > > > > Note: I have a strong personal policy of only using open-source software at home, > > Java's certainly "open source". Whether or not it's "free" depends on > your definitions, and how you feel about the JCP licensing restrictions > on what kind of modifications to the VM you are free to redistribute. > But Java can and is being used to write Free Software, under BSD-style, > Apache, and LGPL licenses (and I have done lots of this). > > > also I hate, HATE Swing as a seperate look and feel to everything else, so I probably > > won't learn Java until I get gnome-gcj up. > > Note that Sun's 1.5 VM will have a GTK+ look and feel for Swing, which > should make you happier... > > > Furthermore... I want to run it as native machine-code, I really don't like the > > smell of virtual machines altogether. :) > > > > The only real political question I can see is... do people really want Swing > > apps depending on JNI? I can only speak for myself, but I sure as s*** don't > > mind one bit. In fact I favour it more than than that childish > > (flames to /dev/null) pure-Java concept. > > This may not be feasible without going through the (ugh) JCP. As I said, > it might be embraced with the right planning, but I am dubious that you > can redistribute code that changes javax.swing.* modules without > permission. > > Anyhow, you might want to try Swing with a recent VM if you are taking > 1.3 as your performance benchmark. Maybe 1.5's improvements will also > help narrow the performance and integration/interop gaps so that using > Swing in non-native mode is more palatable to GNOME developers, too. I > think there are other areas where integration and interoperability work > between GNOME and Java might be even more useful in the future. > > And *please* don't flame me, I am not on the Sun Java team, I didn't > write the licenses, I am *not* a lawyer, etc, etc. :-) I use and write > Java, GNOME, GTK+, etc. > > Best regards, > > Bill > > > > > Bill Haneman <bil...@su...> > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > java-gnome-developer mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-gnome-developer |