Any good suggestion to animations with SWT/JFace - java

I'm developing a desktop application using java + SWT/JFace, which I'm not very familiar. The program need to show some pictures presenting the program's progress like this.
Sorry for my poor English, I'm not sure whether it's suitable to use the word "moving", actually I mean that the diagram is changing like Flash when an event occurs. I'm considering making some flash movies to play, but it seems difficult as I need to add third-party jars and I'm not good at flash. Is there any better way to doing work like this? I need your suggestion.
Thank you and sorry for my poor English again if I made some English mistakes that troubled you :)

You can use java2d and the awt-swt bridge or there is a framework called Timing Framework which works for swt and swing.

probably you need a gif embeded in your window. java cannot paly any animations unless you have series pictures and play them one by one very soon.

Related

Java robot and image comparison

I'm toying with an idea for creating a Java application to automate a process that I have to do regularly and before I start any coding I thought I would seek advice as to the best way to approach it.
Basically, the application I use has a large number of images present on the screen at any one time, and what I would like to know is if there is a way to have Java identify if any of these two images are the same. If they are, I would like to automate mouse movement and button clicks.
After a bit of reading, I'm thinking that the PixelGrabber and Robot classes might be the right way to start, but like I said, I'm looking for any information on this that can be offered.
What are your suggestions?
I believe the Robot class and a Pixel Grabber would be sufficient. If you are inclined to program the solution yourself, maybe for educational purpose, by all means please do. If you, however, don't want to reinvent the wheel, you may take a look at this project:
http://sikuli.org/
I, for example, use it to do stuff that would be hard to achieve with Selenium alone. If you still can't achieve your goal after some scripting, Sikuli provides a nice API which you can use from inside your java program.
The Robot class would be sufficient to take images and being able to inspect pixels. But it seems to make more sense, to recreate your desktop with images inside of a java application (a very simple gallery application). Then operations are simplier. An other way of realizing operations I do not see.

Possible ways to create console like screen in java

I am trying to create a screen like this one
Initially I was trying to port a console program to java. I have found things like jcurses and charva but there is almost no documentation on them and I really cant understand how to use them.
So I figured that I could create a console like screen that resembled the one above.
what library / framwork would I be best using. Should I use swing as it if fully portable?
what would be the best approach being that I need to be able to navigate and alter the 00 in the picture above?
Easily usable would be great but as long as it has good documentation that I can learn it from that would be fine.
(Answering as if you're looking for a hex editor.)
http://jhecomponent.sourceforge.net/
http://www.fifesoft.com/hexeditor/
http://hexedit-lib.sourceforge.net/
Played a bit with the fifesoft.com offering, kinda cool.
If you're not looking for a hex editor, can you be more specific? If you just want a cursor-addressable window you'll probably have to suck it up and figure out something like jcurses or libjcsi :)
If you prefer to create a full fledged GUI with Java you could certainly use Swing. I would prefer SWT as a matter of personal taste, the widget library of Eclipse. You will find a lot of snippets and tutorials (same for Swing). Here is the Widget Library.
Here is a discussion about SWT versus Swing.
You could use the table layout manager to create the layout shown in your screenshot. If you rewrite the application from scretch, you should be able to handle the GUI events and update the widgets according to your application needs. You will easily find articles when you search for swt and table. If you would like to keep the code base and just exchange the GUI, I 'm not sure about the best approach. Maybe, the libs jcurses and charva are the way to go.
Unless you are looking to run the app on a headless VM (where a console/tty is all you've got), I'd use Swing. Create a JTable with a custom TableModel (to provide the data) and custom renderers (to provide the hex formatting) and everything should just work. Consider deriving from the various DefaultXXX implementations to save a lot of work.

How to implement animation into a JFrame

I am used to making web pages with animation using JQuery. I am now making a Java Desktop Application using Netbeans and Netbeans' Swing and without any animation it's looking pretty plain and boring.
Are there any resources I can use for a guide to implement animation into my program?
Does anyone have suggestions on what method to use?
Edit: I am not interested in something I'd have to buy.
A good starting point would be Filthy Rich Clients. Both the principles and the framework code may be helpful to you.
If you're looking for a nice look and feel then Substance might be a good way forward. It's not over-the-top animated or anything like that, but it's got a lot of skins and some in particular look very nice.
Many thanks to stemm who pointed me in the right direction.
I decided to use JavaFX (JavaFX 2 to be exact)
Here is some resources I am using:
http://download.oracle.com/javafx/
http://download.oracle.com/javafx/2.0/swing/jfxpub-swing.htm

GUI frameworks for Java

I was wondering if anyone has any suggestions of frameworks to give an old desktop application a much needed facelift.
The application has had a long life without anyone giving any attention to its exterior resulting in a monster with an 80s look.
I've just downloaded and tried MyDoggy framework for making windows floatable and dockable. So I'm looking similar for quick and easy fixes that will bring a dead looking application back to life.
I think you don't want to rewrite your app, right? Because it seems as all the other guys think so, suggesting SWT and JavaFX.
To pimp your existing Swing App, take a look at jgoodies.com, the substance look and feel or the swinglabs
Just changing the look and feel and some components might already help to give your application a second youth. Consider for example Violet which is IMO a nice looking application. It uses a custom theme based on the PgsLookAndFeel and some components from L2FProd.com.
You could give Oracle's ADF a try.
If you want to go with the latest and greatest, you could try JavaFX. Bu tof course using good old swing or the more OS agnostic SWT does the trick as well.
There's ofcourse the Eclipse Rich Client Platform or the Netbeans Rich Client Platform.

What Java GUI framework is good for a first GUI project?

The title description basically says it all. I'd like to use something that requires a relatively short learning curve since it is my first project and I'd like to spend at least some of it actually writing the code, not just learning how to do it, but also something that has good documentation in a way that some new bleeding edge framework probably wouldn't. Any ideas?
If what you want to do, is actually create a working program with a GUI, and you just want to do that I would recommend looking at the Swing GUI editor in NetBeans, as it is very easy to work with and powerful too.
There is an old demonstration floating around showing how to implement a preference panel like the one in Netscape Navigator (the predecessor to Firefox), but I cannot find it right now.
The Java tutorial trail is here: http://java.sun.com/docs/books/tutorial/uiswing/learn/index.html
EDIT: It appears the preference panel demo has been taken offline. You may want to see this demo for NetBeans 6.0 instead: http://www.javalobby.org/eps/matisse-updates/
It's not clear if you mean a desktop or Web GUI.
For a desktop GUI, just use Java's Swing framework. Creating a GUI With JFC/Swing is a starting point for that. Sure it's old but then again so is Swing. You could also try The Java Swing tutorial.
For a Web GUI, start with servlets/JSPs. Try Servlets and JavaServer Pages (JSP) 1.0: A Tutorial.
Swing + MiGLayout ^^
I know you did say you wanted a simple and easy to learn GUI toolkit. #cletus has nailed that answer :)
But if need to look for alternatives and evaluate them before you decide how to write a GUI, check out this list of alternatives to Swing and AWT.
Swing + GroupLayout
I've been posting on these a couple of times.

Categories

Resources