Casen Densmore

Greenhorn
+ Follow
since Jan 22, 2004
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 Casen Densmore

Ok, I see why it isn't working. I am calling multiple instance of the method therefore it would return a value for each one of them; the last one being false.

The question still remains, how can I manipulate the code so that once a match is found it would return true and stop the recursion?

Thanks,
Casen
12 years ago
I am running a traversal of a JTree trying to find a certain node. When I do find that node I want to return true, indicating that I did in fact find it. The code below always returns false indicating to me that even though I return true when the item is found the loop continues to run.



Here is the print out of the test code.
Match Found!
No Match Found 1
No Match Found 1
false <------- a printout from what is returned.

Any ideas?
Thanks,
Casen
12 years ago
Hello,

I am having trouble with scrolling a JPanel. When it displays the JPanel it is scrolled all the way to the bottom and I can't seem to find a method where I can force the initial location of the "knob" on the Scrollbar.

Here is how I implement the JPanel


I am using a GridBagLayout for the JPanel where I place some buttons and text. Right now I am doing an uber-ugly hack where I place a empty JTextArea at the very top of the JPanel and set the caret position to 0 on that component, but what is the reason it is scrolling all the way to the bottom?

Thanks,
Casen
13 years ago
Anyone know how to change the active title bar color of a jinternalframe. I have looked everywhere and the only thing I found was something like...

try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
UIManager.put("activeCaption", new java.awt.Color(255,225,255));
SwingUtilities.updateComponentTreeUI(this);
} catch(Exception e) {System.out.println("Error setting native LAF: " + e);}

I have tried implementing this... its changes the overall L&F but does not change the specific color of the active title bar..


Any Ideas?
Thanks,
X
14 years ago
Anyone know how to change the active title bar color of an jinternalframe?
I have looked everywhere and the only thing I found was something like...

try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
UIManager.put("activeCaption", new java.awt.Color(255,225,255));
SwingUtilities.updateComponentTreeUI(this)
} catch(Exception e) {System.out.println("Error setting native LAF: " + e);}
14 years ago
DefaultTableModel supports JComboBox just not the way I wanted, you were right, I had to create a CustomTableCellRenderer in order to do the job...Thanks!
Casen
15 years ago
That is what I was looking for, thanks!
Casen
15 years ago
How in the heck do you change the color of a selected titlebar in a jinternalframe. I have serioulsy looked EVERYWHERE. I have tried changing the l&f using UIManager.put but I must be using the wrong name because it won't change, and I have tried many many different names.
Anyone know a way to change it? And if you do use UIManager can you specify the name of the object please?
Thanks,
Casen
15 years ago
Is there anyway to display a jcombobox in a jtable and still have it look exactly like a normal jcombobox.
The problem is my users won't know its a combobox if the arrow isn't there initially. Is there anyway to put an arrow there even if the user doesn't click on the box.
15 years ago
Ya....it was just bad programming.....
15 years ago
Have you tried making the tree expand on loading of the jtree?

perhaps something like this?
jTree.expandPath(new TreePath(root.getPath()));

-Casen
15 years ago
I am guessing you have an action attached to validate the zip code? Why don't you add to that action?

If zipcode is valid, then pull stuff out of database and put into approriate fields.
I may be misunderstanding what you are trying to ask...

-Casen
15 years ago
I am having the problem of an actionListener duplicating, or perhaps an error in my code. When ther user clicks the arrow_left1 button it move nodes from one tree into the another. When they click the save1 button it saves the current information. The problem comes when I try moving stuff over after I have saved the information. For some reason it duplicates itself. The first time I click save it duplicates once, the second time...twice etc....

relevant code is below....
//if save button is pressed
save1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent event) {


Output:
got here
got here

On one click of arrow_left1 after saving got here is printed out twice... Any reason why it would be doing that?
15 years ago
Can you add a mouselistener of sorts to a tab? What kind of listerner would that be?

Thanks,
Casen
15 years ago