Author Topic: Java Swing  (Read 3203 times)

0 Members and 1 Guest are viewing this topic.

Offline Flipside

  • əp!sd!l£
  • 212
Just one quick question, was it called Swing because they hung the people who designed it, and if not, could this be arranged? Thanks.

 

Offline Grimper

  • 28
    • Minecraft
When Australia burned.

Together since the world began, the madman and the lover.

"Post-counts are like digital penises. That's why I don't like Shrike playing with mine." - an0n

 

Offline Flipside

  • əp!sd!l£
  • 212
It's ok, I've been working on my Uni project overnight, and never have I encountered a more bloody-minded, temperamental interface in my life as the Java Swing Interface.

Thinking of swapping to JOgl simply to see if the commands in that interface actually do what they are supposed to every time they are called, since Swing seems to only do what it's supposed to if it is either in the mood, or possibly only on Tuesdays when it's raining.

 

Offline Aardwolf

  • 211
  • Posts: 16,384
    • Minecraft
I've used both, and haven't had too much trouble, but I already knew OpenGL before doing Jogl.

 

Offline Flipside

  • əp!sd!l£
  • 212
Well, on revision, it was partly my own fault, I'd got a Panel hierarchy round the wrong way, and that was causing most of the problems, however, my latest arch-enemy is the Layout Manager ;)

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
I don't remember swing being totally terrible, except for how the GUI looked.
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline Flipside

  • əp!sd!l£
  • 212
Maybe I'm just too 'old-school' but to be honest, I find the entire language somewhat bloated, for want of a better word.

That doesn't make it a bad language, far from it, it's extremely flexible and user-friendly, but I like a simpler toolbox to work with, even if it means more coding, there's just too many times where you pass something off to an internal routine and have little choice but to trust it's going to behave as it says, that's fine 99% of the time, but it always feels a little too 'fly by wire' for my tastes.

 
Try SWT:

http://www.eclipse.org/swt/

You'll say thanks later  :)
----------------------------------------------
GTD Swiss Pride - Orion Class
Swiss 1st Fleet, Sector 32 - Ore Belt - Sol
----------------------------------------------
"I'm an engineer!"

Eve: Since Beta Phase 2
Civilizazion Fan: Seems like forever...
SimCity Fan: SC 2000 is still the best
TT Fan: Since 1995
Switzerland: Since 1291

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
I would say "Thank God it's not wxWidgets", but that would probably just piss people off. Then again, wxWidgets is completely overrated.

So far, the Java swing toolkit has been the best thing I've used that works on any platform, no questions asked. There are some stupid limitations but by far it's a lot more satisfying to write code that looks decent and runs without tweaking your project files to hell, or forcing people to install an additional library.

All that being considered, I haven't had any big complaints about the Java API. I don't think Java is supposed to be optimized, so if you're writing an application with optimization in mind, well, why are you using Java? Everybody knows that if you want fast code, you write binaries with a hex editor in win32 assembly...

However, your idea of using JOGL is a good one. I've always wondered how hard it would be to make a user interface entirely in OpenGL and deploy it using a C application - basically giving yourself an API that works fine with anything that supports OpenGL. It's not exactly the most user-friendly thing but for certain types of applications, it might be better than fussing with any one GUI since you could custom-design your controls for whatever you're working on.
-C

 
All that being considered, I haven't had any big complaints about the Java API. I don't think Java is supposed to be optimized, so if you're writing an application with optimization in mind, well, why are you using Java? Everybody knows that if you want fast code, you write binaries with a hex editor in win32 assembly...

When I was picking my final year project, I talked to a guy who was doing 3D reconstruction work (from an interesting base... can't say any more). He said that at the last place he was at, they were using a Java image processing toolkit that only had a 10% performance hit on the version they wrote in C, but it was much more useable.
STRONGTEA. Why can't the x86 be sane?

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Point...I guess I should reword that.

Optimization isn't really a primary goal or the primary goal with Java. IT's done - it's good coding to do - but my impression has been that if a Java dev comes up against something that would break compatibility or he could choose the more compatible route, but it would run slower, the modus operandi would be to choose the compatibility route. Getting access to lower-level stuff, etc. sounds more like a C paradigm than a Java trait - where the point is to hide as much of the operating system as possible so it remains secure and compatible.

I have talked to a professor, who does research on compilers, who is of the opinion that Java is roughly as fast as C considering the most recent developments. (This was a 5-minute party style conversation, so this shouldn't be taken as a blanket statement either). My point is that as a tool, Java is not something that you turn to if you expect this, without doing some significant research beforehand. The goals of the language are generally at odds with those of lowlevel fine control.
-C

 
Agreed. It really is a case though of how well you understand what you are trying to do. A well written Java program will run many times faster than a really bad written C program (My 3rd year project was writing an optical simulator for a Distributed Bragg Reflector as it was growing in a bath of acid, mine was written in C, but didn't have some of the algorithm optimisations of the MATLAB and Java versions, and was significantly slower)
STRONGTEA. Why can't the x86 be sane?

 

Offline Flipside

  • əp!sd!l£
  • 212
My problem is that Java was the first language I learned in nearly 20 years (I don't count V-Basic as a programming language as such, more like a Macro-language), and the last language I coded in was Z80 on an Amstrad CPC, an 8 Bit-computer running at approx 3KHz, so I have the concept of optimisation built into me, always looking for the fastest way to do things, which isn't always conducive with the programming theory behind Java, which is, at it's heart, designed to be flexible across several different systems.

In essence I'm used to coding with the computer I am sitting at in mind, which is a habit I have to get out of.