Ed Ewing

Greenhorn
+ Follow
since Aug 30, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Ed Ewing

There is a nice directory of java look-and-feels here: http://www.javootoo.com/

You may be able to use the 'Skin' look and feel to emulate KDE.

Good luck!
19 years ago
Yes this seems like the right place to post your question.

I think you should not be trying to write a logging file into a jar file. Certainly you can't write into the same jar file your jnlp application is running from. (Because modifying the file in that way would invalidate the jar signature.)

You need to write your log file somewhere else. Perhaps in the user's home directory, or perhaps ask the user where they want it to be written.
19 years ago
Basically you have to create an instance of the class FileFilter, then call JFileChooser.addChoosableFileFilter().

You will also want to remove the "accept all" file filter. This is the basic idea:


There is a tutorial here:

http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html
19 years ago
The problem might be this line



Or the problem may be that you are trying to access certain System properties. The documentation here might be useful:

http://lopica.sourceforge.net/ref.html#security
19 years ago
On Linux, the files go into your home directory under the directory ".javaws/cache". But you shouldn't need to know that.
19 years ago
In some cases, JComboBox.setPrototypeDisplayValue() can be helpful. It depends on the LayoutManager and the size of the display area whether this will have any affect, but you may want to try it.
19 years ago
Instructions on detecting the presence of WebStart are available on Sun's page:

http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/launch.html

That script seems good at detecting whether WebStart is installed or not. I'm not sure I like their instructions on how to auto-install WebStart if it isn't installed.
19 years ago

Originally posted by seema pal:
"JAR resources in JNLP file are not signed by same certificate."



The error message above seems pretty clear to me. You are required to sign all of the jar files using the same jarsigning certificate.
19 years ago
One of my coworkers is seeing only numbers in his java console, instead of the text that is being sent there.

Have any of you ever seen something like this:





He claims he is using WebStart 1.0.1, and clearly it is JRE 1.5.0.

He probably needs to up-date the version of WebStart, but still this is such funny behavior from the console that I just had to ask if anyone has any explanation.
19 years ago
Here is another link at the sun site about this bug. It seems to have been around for a long time:

http://forum.java.sun.com/thread.jspa?threadID=212136&messageID=727737
19 years ago
You probably need this in your jnlp file:


You will also have to sign your jar files with "jarsigner".
19 years ago

Originally posted by soumya ravindranath:
This is my apache/htdocs/Notepad/notepad.jnlp




It might be possible that the href to java.sun.com is incorrect. As far as I can tell, that is not a valid URL. Simply remove that href and try again:



Note that this is just a guess. You seem to have already tried all the other suggestions I had.
19 years ago
The quick-and-dirty answer is to create a subdirectory in the user's home directory and store your dirty secrets there.

For example:



You could take advantage of the separate Windows and Unix conventions of putting data in "Application Data" and in files beginning with ".". If the directory "Application Data" exists, you know you are on Windows. (But I doubt this works in non-English-speaking environments.)



A more transparent solution is to ask the user where to store files. The first time the program runs, it checks to see if the user has picked a location to store files. You can do this with the Preferences API.
If that directory has been defined, and exists, use it. Otherwise ask the user where to put your files and remember that location with the Preferences API.



Wherever you put the directory, I recommend that you let the user know where that directory is. For example, if you have a "Help->About" menu item, that could give information about where this directory is at, and might give the user a chance to move this directory and/or clear the contents.
19 years ago

Originally posted by Craig Wood:
I would avoid the plaf code option.
Possibilities:
1 — make a method in your app that will do this for each table
2 — make and use a special JTable class that overrides the method



Thanks for the suggestions.

I don't want to do it that way because I want to encourage a consistent JTable look and feel throught the application without needing to edit every place in the code that creates a JTable. The application has a plug-in architecture (partially), so I can't control the code written by others.

Anyway, I found a fairly simple answer to my own question, and I'm going to try this for a while.

Somewhere in the start-up of the application I call:


Where the class MyTableUI is defined like this:




I've left off the import statements, as well as the definition for ColorTableCellRenderer() and ColorTableCellEditor(). Those are based on the ones in Sun's tutorials, but are modified such that "focus", "selected" and "editable" are all taken into account in the same way that they are for the DefaultTableCellRenderer.

Note that this simply re-defines the default renderers for JTable. These defaults can still be overridden by any specific JTable. And I have tested that this looks good with the three big Look-and-Feels: Metal, Aqua, and Windows.

I hope this proves useful to others. It really bothers me that the default renderer for Boolean objects doesn't give good feedback for keyboard focus the way the DefaultTableCellRenderer does. I consider that a bug in Swing. Now that I'm used to using this renderer, it is hard to live without it in other applications.
19 years ago
Hi,

I have written a replacement for the default BooleanTableCellRenderer.

I know how to apply it to a single table:



But I would like to apply it to ALL JTables in my application.

Is there a simple way to do this? My guess is that I need to create a custom LookAndFeel. All the documentation I've seen on that looks very complicated. Isn't there some simple way to change just one part of the look and feel?


FYI:
I don't like the default renderer because it gives no visual clue where the keyboard focus is or whether the cell is editable. Such visual feedback is very useful when moving through the table with keyboard controls rather than the mouse. I made my renderer display "focus" and "editable" properties in the same way that the renderer for Strings does.


Here is the class, in case you'd like to use it too.

19 years ago