Reputation: 7220
I've always worked with web application and that's what I like to do. For my OOP course my professor decided to "impose" me the use of Java. I've always used java to make console application so that's not a problem.
What is the problem? The problem is I've never developed a GUI for desktop application so I was looking for tutorials. I've found some very interesting tutorial but there is something that I can't find there.
Ok, let me explain. As a support framework to write my thesis I've used the Flex 3 version of PureMVC. Flex 3 has something really cool: you can separate your interface structure from your interface "coding". You write the structure in mxml which is an HTML-like language and you can even add style using a CSS-like language. When you add events, you write in a separate class (in AS3) the coding for that event.
Is there something similar for Swing? Or if not Swing is there for Java a GUI library that allows it?
EDIT: Thanks for your answers, I'm still evaluating your solutions.
Upvotes: 4
Views: 1403
Reputation: 1325
I believe this is related to the Groovy Console applet running on Linux rather than to Metawidget itself.
Could you please let me know what problems you're seeing, so that I can attach it to the issue I have open with the Groovy team: http://jira.codehaus.org/browse/GROOVY-3604
Upvotes: 0
Reputation: 4684
You have written you used the Flex version of PureMVC and it was good. Why don't you want to try the Java version if it? PureMVC for Java
I have been using it for 1 year and it works perfectly! You can get all advantages of the MVC pattern and develop really big applications. There is even a multicore version which can be combined with Pipes to let you create MDI applications.
Upvotes: 1
Reputation: 2322
Hm. Maybe I understand this question not fully. But I think it might be worth mentioning these two things:
Yes, Java is "just" code, yet you can surely separate code that creates your graphics from code that takes care of the events. It's actually considered "good practise" to do that. So "When you add events, you write in a separate class the coding for that event." To do that, you use let's say the JFrame class, but let it NOT implement ActionListener. Write your own ActionListener and make an instance of it a member of the JFrame. Then when ever you want to add event code, you put that in the ActionListener.
I have no experience with this in Java, but I know NetBeans comes with a graphics editor, that might take care of the whole graphics coding in a drag-and-drop manner, and there is also Eclipse plugins that offer this feature. I am sure if you use any of those tools, you have graphics and event-handling separate by default as-well.
Hope that helps. If more details needed even after googling, etc. let me know.
Upvotes: 0
Reputation: 27336
You could try the MetaWidget framework whose author describes it as:
Metawidget takes your existing back-end domain objects and creates, at runtime, UI components native to your existing front-end framework:
Upvotes: 0
Reputation: 32831
Perhaps you would be interested by the apache pivot framework.
Upvotes: 1
Reputation: 9446
You could try something like Swing JavaBuilder. It lets you define your GUI's components and layout in YAML, separating the layout definition from the "code" parts. Have a flick through the docs to see if it sounds like what you're looking for.
(Disclaimer: I've heard of this library and thought it sounds like a good idea, but haven't used it yet since I've always coded Swing "by hand").
Upvotes: 4
Reputation: 309028
There's nothing exactly like that for Swing that I know of. Java is code, not markup, so it's going to be different from your HTML/CSS/Flex experience.
Swing was conceived in the late 90s; it's unrealistic to expect it to conform with a 2010 notion of the way UIs are to be built.
You can have L&F that can be swapped out, but it's not like CSS.
The closest thing you'll find to Flex in the Java world is JavaFX. I don't think it's setting the world on fire. The adoption rate isn't what its creators would like.
I'd recommend sucking it up for this course and getting through it.
Upvotes: 2