Sam Ritter

Ranch Hand
+ Follow
since Jan 23, 2018
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sam Ritter

Good point. Perhaps Linux requires the leading / while Windows does not. I'll have to test that. Thanks.
1 day ago
Thanks but I'm not sure I understand. The docs seem to refer to files outside of the jar. I'm having trouble with the path internal to the jar. An I looking at the wrong docs?
1 day ago
I've written an application that works on both Windows and Linux with one exception. I use the following string for a directory path:

I then use that to instantiate a buffered stream thus:

Running the jar on Windows it finds the file but running on Linux I get a file not found exception. Obviously there is a difference in the way the path string needs to be formatted for Linux but I do not know what that is. I can determine the OS and then customize the path as necessary but I need someone to tell me the correct syntax for a Linux path. TIA.
1 day ago
Yes, I guess I will have to develop one. There are only 2 windows open. The main JFrame and this JDialog.
1 month ago
Quick question. Does it matter where in the code the getInputMap is placed? That is before/after setVisible?
1 month ago
Thanks. That got me over the syntax issue but it does not always detect the space bar. I need to play with that a bit to see what is wrong.
1 month ago
I want to take some action on my JDialog when the space bar is pressed. After reading the documentation it seems like I there should be methods named "getInputMap" and "getActionMap" to do the binding. However, they do not seem to exist for a JDialog object. How to I accomplish this using JDialog. TIA.

1 month ago
Sorry about the confusion. It started as what I thought was a simple issue of static methods. It evolved into more details about what I was doing. Responses made it clear my entire approach was wrong (i.e. poor programming practices). I'm working on rewriting the code following the suggestions here, so as far as I'm concerned this question has been answered. Thanks to all.
3 months ago
Yes, I need to rewrite the code.
3 months ago
I have multiple buttons that need to use a different instance of the dialog. I used the suggested JFrame but I guess I need to rewrite it to use a different JDialog for each button so it is not static. When I choose a color, it changes all the buttons not just the one being used. Back to the drawing board.
3 months ago
Nope, that didn't really fix it either. Still working on it.
3 months ago
I figured it out but I don't understand it. The problem was that color was declared locally. I added the color declaration in the class itself rather than in the action listenter and that solved the problem.
3 months ago
I've already looked at that and that is what got me where I am.
3 months ago
Yes but I think we are talking abut 2 different things at this point. I get the static part but I don't get how to set the parameters if I don't get the instance (chooser=new).
3 months ago
Thanks but that does not address the core question. If I use it that way, how do I customize the JColorChooser display? I still somehow need the instance to set parameters.
3 months ago