Java Click me only once
Hi :)
Let's take the following example.... I need two checkbox .. One for bold letters and one for italics... I have written the following function Code:
The prolem is that it is executed 2 times.. One for mouse up event and one for mouse down event What do u suggest me? The following is the function called when a checkbox is clicked Code:
What i must do? |
Keeping it nice and simple and assuming box1 and box2 are both JCheckbox you could define an event listener like this
Code:
private Action checkboxAction=new AbstractAction(){ Code:
|
thx
really thx.....
But how i can preserve the bold and italic attributes concurrently? Code:
|
Basically you subtract ( or add) the value of the style you want to remove/add to/ from the current style and use that new value for the style, example of one of numerous ways is easier to show than explain:
Code:
|
thx
really thx.....works great
|
All times are GMT -5. The time now is 11:18 PM. |