I have started investigating SWT as a platform for a Java based widget library. A quick test on my Fedora machine showed everything I require is possible, plus support for non rectangular windows, err Shells. I will continue my testing on Windows and OS X and see if all of these features work on all platforms. I have my doubts.
EDIT: After a year of not messing with this idea, looks like I can just use the work done by Joshua Marinacci. Thanks!
Wednesday, March 15, 2006
Sunday, March 12, 2006
J2SE and Widgets
I am working on creating a JWidget class and am looking for the correct base class. I want my widget to be always on top, not appear in the windows task bar, have no decorations and accept both mouse and keyboard input. I have investigated JFrame, JWindow and JDialog on J2SE 1.4.2 and J2SE 5. here are the results:
(*) must always be on top.
Unfortunately there are some considerable differences between 1.4.2 and 5. I might want to limit my JWidget class to 1.4.2 functionality to support OS X. more on that later. Provided J2SE is an option, it looks like JDialog is the way to go, though JFrame is perfectly acceptable if being invisible on the task bar is not a concern. I admit I was surprised that JDialog would meet all my requirements, I am going to do some more investigating to make sure that JDialog does not perform oddly on the different platforms.
Also, since these different pieces of functionality are provided by different classes. It looks as though making sensible methods like setVisibleOnTaskBar() will be impossible.
Feature | JFrame | JWindow | JDialog |
---|---|---|---|
Invisible on task bar | NO | YES | YES |
can be always on top | NO | NO | NO |
No Decorations | YES | YES | NO |
Accepts mouse input | YES | YES | YES |
Accepts keyboard input | YES | NO | YES |
Feature | JFrame | JWindow | JDialog |
---|---|---|---|
Invisible on task bar | NO | YES | YES |
can be always on top | YES | YES* | YES |
No Decorations | YES | YES | YES |
Accepts mouse input | YES | YES | YES |
Accepts keyboard input | YES | NO | YES |
Unfortunately there are some considerable differences between 1.4.2 and 5. I might want to limit my JWidget class to 1.4.2 functionality to support OS X. more on that later. Provided J2SE is an option, it looks like JDialog is the way to go, though JFrame is perfectly acceptable if being invisible on the task bar is not a concern. I admit I was surprised that JDialog would meet all my requirements, I am going to do some more investigating to make sure that JDialog does not perform oddly on the different platforms.
Also, since these different pieces of functionality are provided by different classes. It looks as though making sensible methods like setVisibleOnTaskBar() will be impossible.
Subscribe to:
Posts (Atom)