jeremy hull

Greenhorn
+ Follow
since Jan 18, 2001
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 jeremy hull

You did the scrollPane part right, did you try a default table model?
19 years ago
Your table should be added directly to a JScrollPane.
19 years ago
Take a look at a common approach to doing row oriented tables. You can have separate tables that are side-by-side, but line up, appearing to be one table. I have not done it myself, but have seen it done and it looks good, although it may be kinda slow.
19 years ago
Usually in production code you want to have meaningful variable names like okButton, or the like. Also take advantage of JavaDoc, it is a great tool. Your code may be easy to work on, but in a large and comlicated system, or one where many engineers are involved there should be copious documentation.
19 years ago
That is a pretty good book. The other book I use daily is Graphic Java 2: Mastering the JFC by Geary.
19 years ago
Use a java.util.Properties file to save off the current state of the table model before you exit the app. When you load the app, load the settings from the properties file.
Properties props = new Properties(new FileInputStream("table.properties");
props.get("column1.width");
etc... I usually loop through the column headers saving off the setting. It creates the file when you do: props.save();
If you need sample code I got it. email me at jcahull@earthlink.net
You can use this to remember size, location and anything else you can assign to a variable and store as a string, like color and font too.
19 years ago
<HTML><H3>No need to answer this, I got it. If anyone else needs to know I used the following code:</H3>
<BOLD>
private static void setColorResource(String component){
if((myProps.getProperty(component) != null)){
int colorInt = (Integer.parseInt(myProps.getProperty(component)));
UIManager.put(component, new ColorUIResource(colorInt));
}else{
System.out.println("Null Color<set>: " + component);
//UIManager.put(component, new ColorUIResource(Color.lightGray));
}
}
private static void saveColorResource(String component){
if(UIManager.getColor(component) != null){
//System.out.println("save: " + component);
myProps.put(component,String.valueOf((UIManager.getColor(component)).getRGB()));
}else{
System.out.println("Null Color<save>: " + component);
//myProps.put(component,"");
}
</BOLD></HTML>
[This message has been edited by jeremy hull (edited January 26, 2001).]
19 years ago
SwingUtilities.updateComponentTreeUI
OK, what is the deal, I am using UIManager.put(args) and that works, the hashtable is getting updated, but when I try to apply those changes it only wroks once per app. I don't understand why I can't change it all I want.
19 years ago
I am writing my UIManager settings out to a file. I have to convert them to a String to do this. Then I want to get them back from the file and put them into the UIManager hashtable. The problem is that I need to do this:
UIManager.put("Button.background",myProps.getProperty("Button.background"));
>myProps.getProperty("Button.background") returns "javax.swing.plaf.ColorUIResource[r=194,g=191,b=165]"
I need to know if I can convert this to a color that i can put into the UIManager hashtable.
I also need to do this with fonts.
19 years ago
I need to find out how to make a banner (for security classification) that spans the top of the screen, cannot ever be covered or mover or minimized or anything else by the user or any other applications.
19 years ago