john latham

Greenhorn
+ Follow
since May 28, 2006
Merit badge: grant badges
For More
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 john latham

Hi everyone,

Im trying to store an arraylist by serializing it.

The problem is, that it wont work, im getting the not serializable exception:

Is there any way around this? do i need to serialize every object in the arraylist or something? My serialising class and the class of the objects which are found in the arraylist are below:

please help - thanks

The class where i serialize the arraylist



My arraylist which im trying to serialize is full of these objects:
Do i need to make this class extend serializable???


[ April 21, 2007: Message edited by: john latham ]
[ April 21, 2007: Message edited by: john latham ]
16 years ago
thanks for that, works good
17 years ago
Hi,

How do i make cells in my JTable uneditable. The cells that i want to set this way are checkboxes.

What im trying to do is, Only allow for 3 checkboxes max to be selected in my tabel.

And my logic is...if 3 checkboxes have been selected in the table, make all checkboxes that are not checked uneditable ... i tried the following, but it didnt work:



[ September 11, 2006: Message edited by: john latham ]
17 years ago
If you could show the classes which do the resizing and transformations, that would be great, thanks
17 years ago
thanks for your help, also would you be able to post your assignment if you still have it?
17 years ago
Ive now adapted the code (found at the link i mentioned) into my program and it works well. But i dont have any idea on how to resize and rotate the rectangle, any ideas?
17 years ago
Hi everyone,

Im trying to create a rectangle which can be moved and resized by the user by dragging it with the mouse.

I found this file on the internet which moves rectangles but i dont know how to resize the rectangles.

http://www.faqs.org/docs/javap/source/SimpleDrawRects.java

thanks for any help
17 years ago
It works, thank you very much!! Ive never used instanceof before, its very useful.
17 years ago
Hmm i see what you mean, but is it possible to add something i create as an anyonous class and remove it? Because i dont want to make a graph unless the user asks for it.

like this:

if(graph) {
lineGraphPanel.add(new LineGraphGui("Node "+row, "Time", "Temperature"));
lineGraphPanel.validate();
}

else {
this.lineGraphPanel.remove(???);
lineGraphPanel.validate();
}
17 years ago
Now that i can add a component dynamically, i would like to also remove it when needed.

How would i go about this, currently this is what im doing in my actionPerformed method:

if the checkbox is checked add the graph to the panel, if unchecked remove it from the panel. The problem is im making the panel on the fly so i cant use .remove to get rid of it, or can I? Here is my attempt


[ September 07, 2006: Message edited by: john latham ]
17 years ago
Thanks for all your help, It works well
17 years ago
It didnt work, but here is the complete source code. Note im using an external library to build the graph. You can download the jar here: http://prdownloads.sourceforge.net/jchart2d/jchart2d-2.0.0.jar?download


[ September 07, 2006: Message edited by: john latham ]
17 years ago
ok, i ive just done what you said and i have found some problems.

When i try to add the LineGraphGui to the main panel(by pressing the button), nothing happens.

And just as a test i tried adding the LineGraphGui before runtime to see if everything is ok, but it wasnt. It is appearing really small on the screen just like before.

Any ideas?


[ September 07, 2006: Message edited by: john latham ]
17 years ago
Also, i forgot to mention that the Jpanel that im adding to is initally empty, maybe thats the problem?
17 years ago
hi,

no its not the same size as the other stuff in the main panel. Actually the added panel is shown in a 1 by 1 box which you can just see. Do you have any other ideas that might help?
17 years ago