This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
i have 2 problems. 1st --> i want the blue color label(seat) retrieved from seatNumber.txt cannot be mouseClick and etc. But the one i run the seat normally display as blue color. first text in my searNumber.txt is 1, so the 1st label in the panel cannot be mouseClick and etc, it ONLY be blue color, but the rest blue color label can be mouseClick... i want all the blue color label cannot be mouseClick... maybe something wrong about my arrangement of coding, but i still cannot figure out, and tried so many times swapping them.
2st --> once i click on the "confirm" button, it can saved the name of labels(i given them a name for each label) into seatNumber.txt, but it keep repeating the name,for example:
i click 2 labels(named "3" and "4") on the panel, and click confirm button. It save the name of "3" 5 times, and "4" 5 times as well.
so i think is my looping problem but i keep chaging the arrangement,still nothing works.
so i'm here to ask for help. here is my files:
here is the txt file: seatNumber.txt
[ October 17, 2006: Message edited by: Nicky Eng ]
From NickyEng
Diploma in Computer Studies
SCJP 1.4
SCWCD 1.4
Formula 1 app by Maxis (Playbook)
I think the basis of you program should be a class called Seat (extends JLabel). your program can then interact with 'seat' variables (whatever you want to include)
here's a simple demo. click a square - turns red, click it again - reverts to green. click confirm - any red turns to blue.
Nicky Eng
Ranch Hand
Joined: Mar 26, 2005
Posts: 378
posted
0
its good. but i need to retrieve from a text file, that's a requirement for my project.
yahooo...my problem 1 has been solved. i just need to cut this:
and paste to :
and i been forgot to close the bufferedReader b4 catch statement.
Tonite i will look at the problem 2. [ October 18, 2006: Message edited by: Nicky Eng ]