Results 1 to 4 of 4
Thread: JLabel highlighting in crossword
- 05-09-2012, 01:53 AM #1
Member
- Join Date
- May 2012
- Posts
- 2
- Rep Power
- 0
JLabel highlighting in crossword
Hey guys, Im programming a crossword in Java, I have finished GUI and everything, my crossword consists of two-dimensional array[][] of JLabels- cells.
Now i want to add a MouseListener that when i click on one cell in the crossword, it will change color. I know that JComponents haave setBackground(Color) method, but the problem is, that I dont know how to code which particular cell i clicked on.
Sorry for my English, hope u understood me.. :)
- 05-09-2012, 05:10 AM #2
Re: JLabel highlighting in crossword
Moved from New to Java.
MouseEvent has a method that returns the source of the event.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 05-09-2012, 05:10 PM #3
Member
- Join Date
- May 2012
- Posts
- 2
- Rep Power
- 0
Re: JLabel highlighting in crossword
And what that is? Could u be more specific pls? :)
- 05-09-2012, 07:31 PM #4
Re: JLabel highlighting in crossword
No, I don't believe in spoonfeeding. Read the API and find out for yourself, and/or go through the Oracle tutorials.
Also, please spell words in full -- 'you' not 'u' -- this is a programming forum, not SMS chat.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
HIGHLIGHTING certain strings
By onions in forum New To JavaReplies: 3Last Post: 05-01-2012, 05:04 PM -
Crossword PUzzle Help Please
By Sapana in forum New To JavaReplies: 3Last Post: 11-16-2011, 09:24 PM -
Highlighting line in JTextArea
By misiom1 in forum New To JavaReplies: 4Last Post: 01-15-2011, 01:39 PM -
StringIndexOutOfBoundsException- Crossword Solver App.
By numbskull20 in forum Advanced JavaReplies: 3Last Post: 12-01-2010, 01:33 PM -
Adding a JLabel to a JPanel - jlabel not showing
By Bongeh in forum New To JavaReplies: 17Last Post: 04-06-2010, 11:02 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks