toya kin

Greenhorn
+ Follow
since Oct 14, 2005
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 toya kin

Hi guys,

I am a windows user even though i'm not proud of it. One day i used the "Disk Clean-up Wizard"
and then after that i found that when i run my compiled class files it always give me

Exception in Thread "main" java.lang.NoClassDefFoundError: <ClassName>

and i asked my friend and he said that it's probably the windows env variable CLASSPATH or Path is altered, so i changed them both to (added) the JDK bin folder, and i rebooted but i still get the same error message

so if anyone have experienced a same problem or are able to help me i'd really appreciate it
18 years ago
hi guys, thanks for your attention btw
so i've come to something weird that made me think that no changes to a JPanel can be done inside the actionPerformed method

so here is how it started
Say that you want to change the whole content of a panel (i think...)
the easiest thing to do is just probably create another panel then you do whatever you do inside that new panel, when you want to change it, just remove that newly created panel then create and add another one
so i made a button that when clicked remove a panel, then add another one to the main container (the one i got from getContentPane()), but it didn't work, so then i tried adding pane.validate() and pane.repaint() (pane is the main container) and they didn't work either
and then i checked both my textbooks and found that they don't have in depth discussion on these things

so i would really appreciate if someone points me the direction to a tutorial on this or explain it to me directly
thx
18 years ago
well, you made it like that


and there is a logic error, if you want the user to keep inputting until he has inputted it correctly then

will make user keep inputting a double until they inputted a value that is above 4.0 (which is what you DONT want)

should be something like this


and i wonder why you don't use switch, and why you use double for the input number, because this can cause user to be able to input a double value.
18 years ago