As we know that we can use NetBeans for creating Swing programs (with drag and drop the code for each part of Swing will be written automatically)
Is there any software that help us write Java 3d code without writing code manually?
I don't think there's anything out there like that for almost any languages. The problem is... what exactly are you creating? With swing you know you are making a GUI for a certain set of applications but with 3D, the applications are endless. The only thing out there are APIs to help with your job. If you are an animator or game maker there are plenty of game engines to help you out.
Widening your question slightly if what you're looking for is a more productive 3D java environment (rather than Java 3D itself) then Demicron's WireFusion is worth a look. It's Java based and the higher-end versions allow pretty comprehensive access to the underlying engine so you can effectively extend it to do nearly anything.
I've used it for a project or two and I highly recommend it, the only issue is it's ridiculously expensive - in fact jaw-drop'ingly so.
Related
I hope somebody can help me and you fiund this question useful and interesting.
I'm making a Java application for my degree project using a Raspberry Pi. I'm programming all in Java and Linux, but now that I'm starting some developing tests,I found an important issue.
I built all the user interfaces of the application using Java Swing, and although on Linux it runs quite well, I'm detecting bad perdormance on the Raspi, because the GUIs behave wuite slow on the Rapi and the CPU has a huge load.
I've been searching on the net for performance tests and comparisons between main GUIs in Java, but I didn't found relevant results for my problem. Some programmers talk about is better to use AWT or SWT over Swing. I also found that maybe the best approach is to use the LWUIT, but this framework is for Java ME apps and I'm developing my application using Java SE.
Does anybody know which is the best performance Java GUI for the Raspi? The main elements I'm using are: Jlist of Elements (designed as an ArrayList), a few JButtons, pop-ups, key and mouse listners and custom images (for the backgrounds and for the image preview icon of the elements). I want to keep it simple, fast, with the minimum CPU charge and best performance on the raspi. Any ideas for the best GUI in this scenario?
Thank you so much!
Best regards.
I'm looking for a good (hopefully free) 2d graphical library in C++, or in worst case, Java, which helps create the look and feel of Flash animations, the typical ones you can find in most flash games.
The best would be if it provided most of the features and easiness of Flash animation programming, like layers, or even collision detection, etc., without all the micromanagement of pixels typical for opengl. Of course, it can be built upon opengl...
Edit: interactivity is important, it might not been clear in the first description. So I'm not aiming just for an animation, or presentation. A good collision, gravity, etc. system is very much welcome, as are good GUI widgets.
Checkout the new ForPlay from Google.
It compiles to java, javascript, android and more.
Edit: Moved and name changed to PlayN
There is also a stackoverflow tag
Potential ideas:
Processing has been used to make some very good visualizations.... depending on what you want to do this may be a good option.
JavaFX was designed as a framework for building Rich Internet Applications (a bit like Flash). I think it has a lot of the Flash-like features you are referring to.
I don't know if this is exactly what you're looking for, but you can take a look at SFML.
After spending a lot of time and code on programming in Swing, I thought this can't be state-of-the-art Java GUI building. After not finding a user-friendly visual gui bilder for eclipse I stumbled upon declarative GUI building with XML UI toolkits... and I thought: This must be it! I think it's the right way to go, easy and also close to web-programming.
But after looking around in the web and on SO, I got the impression that it is not very common! Although there are many implementations and APIs, it seems like most of them are kind of dead and had no updates in the last 5 years..
So I wonder: Is my feeling right, that XML is not very widespread for java GUIs? And if so - what are the reasons? Maybe it couldn't become accepted or it has some major drawbacks or people are doing everything in the web instead with fatclients or there are better alternatives, maybe javafx?
I just need to know if it is worth spending time in that area or better look for alternate ways. As I dont read developer magazines I just don't know what the trends in gui building are and which technologies are believed to have a future. But I can't imagine that people still spend so much time on writing nasty swing (or swt) apps.
There new fresh and interesting approach - it uses YAML. Check it out at http://code.google.com/p/javabuilders/
Sun's answer to that seems to be JavaFX.
It has a declarative language for specifying the GUI and there will be builder apps as well.
There is some prototype work going on for e4 (Eclipse 4), which would allow building a GUI by editing an Ecore model and customizing it via CSS.
See this blog post for some details and instructions to try it out yourself.
Five to ten years ago XML was very popular. Although fine to provide some kind of standardisation for transferring data between heterogeneous systems, it's not suitable for programming. It always starts with the easy stuff, and lets declare everything. But any real system requires code. XML then falls down. There is also the problem that XML is a bad syntax for humans, and even languages like Java are easier to read.
On the other hand, there is clearly a need for the rails of GUIs. Naked Objects is the closest reasonable attempt I have seen.
I came to the same conclusions as you about the declarative frameworks out there. It is not worth learning a new GUI syntax unless it's widely supported. XUL as an interface language is widespread, but there is no java rendering framework for it. I'd say HTML+CSS+Javascript and a Servlet container is the best Java platform for GUIs today, but sadly I haven't found a platform independent way to display web pages like a desktop application.
If you use Eclipse, you can now use WindowBuilder to help you in creating Swing apps in a user-friendly visual GUI builder. It's now available as a free download, and Google has donated the Swing GUI builder framework to the Eclipse Foundation.
I'd second Thilos suggestion with javaFX.
Additionally the trend is pointing to webapps, so I think that in the long run javaFX and web based UIs will catch up to swing+swt GUIs.
I do all my swing stuff by hand and none of my application is nasty. If you do not know how to create usable and good looking UI there is no technology to help you.
The answer is surely not going to be XML. What problem are you trying to solve? You want to have reusable building blocks, and a compact way of describing them. I don't see XML helping you there.
[edit] Creating a java code equivalent of XUL would be an immense improvement on XUL.
XML makes it really, really hard to do good separation of concerns and once and only once. It is however perfect for the mongolian horde approach. You need a layer on top of swing, it only provides the building blocks.
Swing is good in many ways, then why do we need JavaFX?
There is both a technology part of JavaFX that will help design UIs, and a language part that will make writing UIs easier.
The JavaFX technology brings a 2d scenegraph and video capabilities. Afaik these will also be made available generally to java. They are good advancements for creating client side application with fancy and interactive graphical UIs. The 2d scenegraph should make it possible to create more graphic heavy applications that are still responsive.
The JavaFX language is a much better way off creating UIs programatically. Java Swing code can get very verbose, while the same JavaFX code will be smaller and easier to maintain. Closure support makes creating event handlers easier. Declerative assignment of settings makes configuration of elements easier. Native list syntax makes adding components easier.
Please note that I haven't really written any JavaFX, but I have read code and paid attention to what's going on. I recommend trying it yourself to find out what's cooking.
I think Staale's answer is a good start but I would add...
Use JavaFX if
1) If you're interested in developing the application for mobile or TV (note this has yet to be released)
2) If you're working with a graphic designer who is creating the appearance of the application in photoshop and you want to be able to import their look directly.
3) If making the GUI filthy rich is important to you. (so if you want a panel to fade in or out, or slide upon demand)
Use Swing if
1) You're creating an application mainly for the desktop.
2) Performance matters and you know what you are doing (so if you're writing an IDE, Swing would be a better choice)
3) You're looking for a RPC (rich client platform) to build upon.
It is the same reason why we have Java, C++, C#, Python, Perl, Ruby... although we already have C.
Obviously the Java API reference, but what else is there that you all use?
I've been doing web development my entire career. Lately I've been messing around a lot with Groovy and I've decided to do a small application in Griffon just to experiment more with Groovy and also break some ground in desktop development. The only thing is I'm totally green when it comes to desktop apps.
So, world, where's a good place to start?
The Swing Tutorial is very good. Apart from that, the Swing API is obviously the reference, however it's also a treasure trove of fairly good source code! Add the API source to your IDE and you can jump directly to the implementation to all the Swing classes. This is a great way to explore the functionality, see how various Swing components work and learn a good Swing "style". Furthermore, it's great to be able to step through the API classes if things don't seem to work and you have no idea why! Adding the API source to the IDE has the additional benefit that you get all the JavaDocs along with it, although all modern IDEs can also pull them from the net -- you do not want to program desktop Java without the documentation available from within the IDE!
NetBeans and other IDEs do make the creation of IDEs very easy, but be aware that there is a lot more to Swing than just containers and layout managers. In fact, containers and layout managers are among the easier things, and I'd recommend learning to use them by hand, too. There is nothing at all wrong with using a GUI builder, but in some cases it's overkill, and then it's nicer to just quickly whip up a GUI from source. In other cases you need to be able to create a GUI dynamically and then GUI builders are no use at all! For creating very complex layouts from source, I recommend FormLayout, which has its own set of quirks, but which does scale (in terms of programming effort) to very big frames and layouts.
If you've only done Groovy so far, you'll be surprised how well documented Swing and the rest of the Java API is and how well everything is integrated. It might also take some getting used to a different style of programming, using the debugger more often and println-debugging less, etc. There might also be some "boiler-plate" code that will be very annoying. ;) Enjoy.
The Sun Java tutorials are pretty good. I cannot vouch specifically for the Swing one as it has been ages since I've done any Swing development and I have not read it myself.
Creating a GUI with JFC/Swing
When it comes to developing java desktop applications, I would highly recommend using the IDE environment Netbeans. Especially when it comes to the development of Swing based applications.
I recommend you to play around with netbeans. It will allow you to build complete GUIs using only your mouse. Once you get familiar with Swing components, start using the Java API. Thats how I started.
The O'Reilly Swing Book is a pretty good reference, it has a good overview of general Swing concepts and covers each of the major classes. I used it recently when I had to refresh my memory on Swing.