MDI in SWT on Linux? - java

I'd like to create an MDI application using SWT.
I've done extensive searches and reach that the Decorations Object is the one responsable for trying supporting behavior. However, I've a Linux box, and the example provided
doesn't work for me.
The output of the example provided by the above link is:
Image
However, on Linux (GTK), I see only labels without control bars or boxes!

You might want to take a look at the Eclipse Rich Client Platform. It's built on SWT and gives you the full flexibility of the Eclipse User Interface (with views and editors) - and lots of other interesting stuff like a smart plug-in and modularization system or a full-fledged online help. Take a look at the RCP Mail Demo - it's a simple demo program that shows you how to create different views and move them around. (I'd offer my tutorial, but it's written in german. You'll find lots of good stuff around the net.) If you're still interested, there's a book named Eclipse Rich Client Platform available by Jeff McAffer - excellent guide.

Use the Novocode Application Framework. It has a Desktop Form for exactly that, and I like it, even if tabs are all the hype now. I already used it with great success!
(source: novocode.com)

Related

How to create buttons and other images required for a project

Basically I am Java developer and I want to know how can I create buttons and other images required for my Java project.
As per my knowledge we will use photoshop for creating images.
But can anybody tell me exact process and any related videos or links showing how to do this task.
Take a look at Oracle's Swing Tutorial it should get you started in the right direction.
EDIT: As per your comment, you might want to take a look at this tutorial. As far as buttons and images are concerned, you just need to us the plain HTML tags. Also, if you are considering building an N-Tier Web Application you could consider taking a look at a framework such as Spring (tutorial here). Spring should make some things easier.
TRY Synth (Java 1.5 and above) .
This can convert the xml into Gui component. This is used for custom gui.
See this link:
http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/synth.html
Normally Web developers uses the Adobe Photoshop and other Adobe tools for Creating the buttons and other images required for the project and finally they will come up with a Prototype.
Java Developers uses the the files(.js,.jpg...etc) created by the web devlopers and they will write the business logic and DAO implementation.

SWT open source applications gallery?

I'm new to SWT/JFace. I would like to know if someone could indicate real world apllications based on SWT/Jface but not on Eclipse RCP. I can see lot of examples (come of them very professional) of RCP based apps, but nothing about SWT/Jface standalone.
I would like to start to develop an utility app with these libraries (instead of Swing), and a well done, commerical quality, example application would help a lot to start the right way...
Thanks a lot,
Giovanni
See a list of real-world SWT applications here.
I'm working on Zekr, which is only based on SWT (neither RPC nor JFace).

What should I choose SWT or Swing to program GUI in Java?

I need to create a GUI application in Java. I just realized that I have different optional ways to go (SWT and Swing are among them).
I have already found out that there is a lot of discussions about what way is better and I do not want to go to deep into these discussions (I am a newbie).
I do not care about all aspects of the dilemma. I just have a few main requirements listed bellow:
It should be easy to use (easy to create what I want).
In the end I would like to have just one file which can be easily executed (without any additional tricks, settings and installations) like a standalone application.
It should be platform independent. Or more specifically, the application should work fine on Microsoft-Windows and Ubuntu (Linux).
Based on your requirements, I would say Swing. SWT has a more platform-specific look about it but Java ships with Swing built-in, there's no messing about with external libraries as with SWT although the use of Eclipse may make that much easier (I still develop quite a bit of my stuff from the command line unfortunately).
They're both easy in terms of use (well, easy once you get used to layout managers) and will work fine under both your desired platforms but since the only differentiator you seem to care about is the "without any additional tricks, settings and installations", I would stick with Swing.
That's my advice. Feel free to accept or ignore or even call me an old coot. I won't take offence :-)
I just completed a two year project creating a buisiness application, so my focus was clearly on usability and speed.
My decision in the end clearly led to SWT, for the following reasons:
Buisiness users tend to use Terminal Servers and RDP for their apps. Every Swing app is very slow over RDP, because the app has to render every pixel again and again. Try using Photoshop or Gimp over RDP and start scrolling in an image. That is the performance you have with Swing in tables.
Some very good gui components are only available as COM objects. I wanted to be able to use those, and since 100% of all buisiness customers are Windows users, they accept the fact that your software only runs on Windows. (We have linux clients, too, but only for machine input terminals, that don't need the full blown Windows GUIs)
We use SWTDesigner as a GUI designer, which is as good as SwingDesigner für Swing (which both are the best GUI designers at all). They are worth the price tag if you have to create a few hundred masks.
Our GUI looks 100% native, honors the large fonts they use on their desktops, and feels fast.
We are very satisfied with SWT, but it has some downsides:
Native Java components are a bit rare. There is more on the Swing side of life.
I would suggest that you use Java's Swing libraries if you are not familiar with Java GUI development. They are very well documented, and there are lots of tutorials on-line, including on Sun's Java website (here).
GUI development in Java is not very straightforward, but the tools available are getting better all the time. I would suggest you try out the NetBeans IDE that has a nice visual designer for GUI components. I have not used the Eclipse IDE's GUI designer, but I gather its good as well. You will need to get your head around the MVC pattern, but it should be a good learning experience.
In short, my vote goes for using Swing/JFC, especially if you are new to Java GUI development.
EDIT - You can control the look and feel of a Java APP very easily. If you use the platform independent (Metal) look and feel, your GUI will look pretty much identical on Windows and on Linux. Of course, a Java app will run just fine on Windows of *nux as long as there is a supported JVM installed.
I cannot add comment yet because I'm new here (please mod me up so I can comment) but choosing Swing or SWT depends on the IDE you're using.
If you're using Eclipse, then both are fine.
If you're using the free IntelliJ IDEA community edition, you'll prefer to use Swing because the IDE's GUI editor is "Swing only".
I take it you're using Eclipse?
Based on your requirements, I recommend using Swing:
SWT requires additional native libraries (violates item #2),
You are likely to find more instructional material on Swing (since you are a newbie),
Both solutions are somewhat platform independent and supported on both platform you mentioned but SWT is not equally supported on all platforms,
There are more WYSIWYG tools supporting Swing which may help with the learning curve.
Note that the APIs are similar and sometimes identical so learning one gives you a head start on the other.
I find Netbeans' drag and drop visual editor and pre-wired Swing Desktop Application template much easier to use that what comes bundled with Eclipse, so I'd suggest that.
It'll automatically create an executable jar, and let you create a Java Web Start launcher if you wish as well. And being Java, it's OS-independent.
Here's a link to the quickstart tutorials.
Swing,
SWT works on Ubuntu but not nearly as well as on Windows, that's at least my experience. The main reason to choose SWT is if you want to build your application on the Eclipse RCP framework( where you get a dockable views/editors, plugin mechanism, automatic updates, user roles. help browser, preference mechanism etc) or if you want your application to have that polished native look.
From my experience, if you want easy to develop Swing is the way to go. If you need good performance, then SWT is a better bet.
NOTE: The last time I did GUI development in Java was 4 years ago.

CDC finger-friendly

I've been working in a Java mobile project using j9 as a virtual machine. So far the project has been developed for an stylus interaction using AWT components.
We want to create a new version of the application more finger-friendly the internal logic is working OK so we wanna keep it, it is just the interface that we want to update.
From what I´ve read the alternative is the LWUIT library, however it is just for CLDC configuration or for JavaTV, and the implementation on Java TV apparently doesn't work on J9.
So, any suggestion? anyone have done something finger-friendly using j9?
I'm thinking in develop buttons as images and give the fight against the layouts to make it look good, In other words, create the finger-friendly library from AWT, but I still having doubts about this approach, because there are some things that i don't know if possible, like the finger drag&drop to move between pages.
Anyway, any Ideas of how should I approach this challenge will be very appreciated!
Thanks,
Gustavo.
As far as mobile java on mobile windows, J9 is the way to go. I've used it for a few projects and it fit the bill perfectly. I used it on a rugged hand-held device and developed a few applications for measuring shellfish. The interface was geared for both left and right handed people and aimed at the stylus as well fingertip interaction.
I think the toolkits you're looking for are SWT and JFace. JFace is what gives you the flexibility to create really slick UI elements without a lot of code. There will be some small differences between your GUI designer and the actual device display - but nothing horrifying. Installing and configuring the jars on the device is pretty simple, and if you integrate rapitools and the cab wizard into your ant build you can come up with some slick deployment and installer solutions.
Grab this book and get started.

Embedding Flash / Flex component into Java app

I'm working on some Flex spike in my company. We are basically evaluating different scenarios etc. What solution would you recommend for embedding Flex components into Java app? Flex <-> Java communication is not (yet...) an issue, just embedding swf into JFrame.
I've done it with EasyJCom. It's pretty straight forward as long as you're using one of the standard Java windowing libraries (Swing, awt). You can see an example (From the EZJCom site) here: http://www.ezjcom.com/FlashTest.java.txt
The people responsible for EasyJCom are also very responsive, and even though we ended up not using their product (Switching platforms), I'd recommend them.
I haven't used JFlashPlayer, but did take a look at the docs, it seems to be adequate as well. I think their license requires you to obfuscate your code. I thought it was a little odd, but maybe I mis-understood the license.
It gets quite a bit more complicated if you don't want to use Com, or if you need to embed in another type of window.
If you need to embed flash cross platform, you may be stuck rolling your own Jini library for the Mozilla plugin. At that point... Maybe it's worth just switching platforms if you aren't too far in. ;)
Haven't tested this, but it looks like JFlashPlayer will do the job. http://www.jpackages.com/jflashplayer/
None of these supports Linux or MacOS. So much for the cross-platform Java and Flash.
I think the best way to do something like this would be to embed something like xulrunner into your java app then have the java app interact with flash via the xulrunner interfaces.

Categories