Deselection of a button

hi
in the following code,
we can click on a button and draw that geometric shape.
the problem is that i wnt that shape to b drawn only once for every click.
ie- the button should b deselected after the selected figure is drawn once..
plz suggest changes in the code.
plz help....
CODE is as follows:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.lang.Math;
import java.util.Vector;
<APPLET
CODE = Draw.class
WIDTH = 350
HEIGHT = 280 >
</APPLET>
public class Draw extends Applet {
Button lineButton = new Button("Line");
Button ovalButton = new Button("Oval");
Button rectButton = new Button("Rectangle");
Button clearButton = new Button("Clear");
MyCanvas canvas = new MyCanvas(TwoPointObject.LINE);
int screenWidth = 400;
int screenHeight = 400;
public void init() {
setBackground(Color.white);
setLayout(new BorderLayout());
add("Center",canvas);
setupButtons();
resize(screenWidth,screenHeight);
void setupButtons() {
lineButton.addActionListener(new ButtonHandler());
ovalButton.addActionListener(new ButtonHandler());
rectButton.addActionListener(new ButtonHandler());
clearButton.addActionListener(new ButtonHandler());
Panel panel = new Panel();
panel.add(lineButton);
panel.add(ovalButton);
panel.add(rectButton);
panel.add(clearButton);
add("North",panel);
class ButtonHandler implements ActionListener {
public void actionPerformed(ActionEvent ev){
String s=ev.getActionCommand();
if(s.equals("Clear")) canvas.clear();
else if(s.equals("Line"))
canvas.setTool(TwoPointObject.LINE);
else if(s.equals("Oval"))
canvas.setTool(TwoPointObject.OVAL);
else if(s.equals("Rectangle"))
canvas.setTool(TwoPointObject.RECTANGLE);
class MyCanvas extends Canvas {
int tool = TwoPointObject.LINE;
Vector objects = new Vector();
TwoPointObject current;
boolean newObject = false;
public MyCanvas(int toolType) {
super();
tool = toolType;
addMouseListener(new MouseHandler());
addMouseMotionListener(new MouseMotionHandler());
public void setTool(int toolType) {
tool = toolType;
public void clear() {
objects.removeAllElements();
repaint();
public void paint(Graphics g) {
int numObjects = objects.size();
for(int i=0;i<numObjects;++i) {
TwoPointObject obj = (TwoPointObject) objects.elementAt(i);
obj.draw(g);
if(newObject) current.draw(g);
class MouseHandler extends MouseAdapter {
public void mousePressed(MouseEvent e){
current = new TwoPointObject(tool,e.getX(),e.getY());
newObject = true;
public void mouseReleased(MouseEvent e){
if(newObject) {
objects.addElement(current);
newObject = false;
class MouseMotionHandler extends MouseMotionAdapter {
public void mouseDragged(MouseEvent e){
int x = e.getX();
int y = e.getY();
if(newObject) {
int oldX = current.endX;
int oldY = current.endY;
if(tool != TwoPointObject.LINE) {
if(x > current.startX) current.endX = x;
if(y > current.startY) current.endY = y;
int width = Math.max(oldX,current.endX) - current.startX + 1;
int height = Math.max(oldY,current.endY) - current.startY + 1;
repaint(current.startX,current.startY,width,height);
}else{
current.endX = x;
current.endY = y;
int startX = Math.min(Math.min(current.startX,current.endX),oldX);
int startY = Math.min(Math.min(current.startY,current.endY),oldY);
int endX = Math.max(Math.max(current.startX,current.endX),oldX);
int endY = Math.max(Math.max(current.startY,current.endY),oldY);
repaint(startX,startY,endX-startX+1,endY-startY+1);
class TwoPointObject {
public static int LINE = 0;
public static int OVAL = 1;
public static int RECTANGLE = 2;
public int type, startX, startY, endX, endY;
public TwoPointObject(int objectType,int x1,int y1,int x2,int y2) {
type = objectType;
startX = x1;
startY = y1;
endX = x2;
endY = y2;
public TwoPointObject(int objectType,int x,int y) {
this(objectType,x,y,x,y);
public TwoPointObject() {
this(LINE,0,0,0,0);
public void draw(Graphics g) {
if(type == LINE) g.drawLine(startX,startY,endX,endY);
else{
int w = Math.abs(endX - startX);
int l = Math.abs(endY - startY);
if(type == OVAL) g.drawOval(startX,startY,w,l);
else g.drawRect(startX,startY,w,l);
}

can anyone HELP me, pleeeease

Similar Messages

  • How to unselect / deselect a radio button in Reader?

    How do you unselect / deselect a radio button in Reader? Like if you have a group of radio buttons with three choices, and the end-user selects one but then wants to unselect / deselect the choice and leave that radio button group blank / unanswered.
    Thanks,

    You should be able to go to the Forms menu, and the last option is to clear the fields.  It will take all of the information out of the form, but it will also clear out the radio buttons.  I hope that this helps!  Have a great day!

  • How to deselect the Radio button from htmlb.table.TableView

    Hi Experts,
    Could you please help me, how to seselect the Radio button from htmlb.table.TableView?
    <hbj:tableView
                                       id="tbvCustomer"
                                       model="mcBean.csModel"
                                       design="ALTERNATING"
                                       headerVisible="TRUE"
                                       footerVisible="TRUE"
                                       navigationMode="BYPAGE"
                                       selectionMode="SINGLESELECT"                               
                                       fillUpEmptyRows="FALSE"
                                       headerText="Searchresults"
                                       visibleRowCount="10"
                                       onNavigate="CustomerSearchNavigate"
                                       visibleFirstRow="<%=mcBean.getCsVisibleFirstRow() %>">
    Problem: After searching and selecting the Customer in the table, then again we are searching for another customer. After that the searched customer is displaying in the Table. By default the table Radio button is selected. Because for first Customer we have selected the Radio button. How we can deselect the FRadio button while searching for another Customer.
    Thanks In Advance.
    Regards,
    Vijay.

    I think it is <2095>.
    In SmartForms, go to your text window. 
    Use the icon on the top left of the text window to switch to the old editor.
    INSERT -> CHARACTERS -> SAP ICONS. 
    Do a FIND on "radio".  It's called ICON_WD_RADIO_BUTTON_EMPTY.

  • Deselect the Radio Button

    Hi,
    I am new to PHP.How do deselect the selected radio button.I have 4 radio button . If i select one radio button .Then How do the selected radio button go to deselected whenever i click the submit button.
    Anybody help me??
    Thanx

    Hi!,
    Try..
    <html>
    <head><title></title>
    <script>
    function DisableIt(pizzasize)
         for(var k=0;k<pizzasize.length;k++)
              if(pizzasize[k].checked)      
              pizzasize[k].checked=false;
    <!-- myForm.submit(); -->
    </script>
    </head>
    <body>
    <FORM ACTION="" NAME="myForm">
    <INPUT TYPE=RADIO NAME="pizzasize" VALUE="S">small<BR>
    <INPUT TYPE=RADIO NAME="pizzasize" VALUE="S">small1<BR>
    <INPUT TYPE=RADIO NAME="pizzasize" VALUE="S">small2<BR>
    <INPUT TYPE=RADIO NAME="pizzasize" VALUE="S">small3<BR>
    <INPUT TYPE=button VALUE="submit" onClick="javascript:DisableIt(myForm.pizzasize)">
    </FORM>
    </body>
    </html>
    Message was edited by:
    ushastry

  • Radio button selection, deselecting others

    My experience with "radio" buttons in GUI libraries is that selecting one in a group deselects any other button in that group -- kinda like a car radio (hence "radio" button).  How do we do that in LabView?  I thought I had seen a property to do that (though I may have been using some other GUI at the time)
       ...Dan

    Hi Dan,
    If you are using LabVIEW 7.1 or later, you can use the Radio Buttons Control in the Boolean palette to accomplish exactly what you're looking for.  If you're using a previous version of LabVIEW, you will have to write the underlying code to do this selection/deselection yourself...I'm sure you can find an example of how to do this on these forums somewhere.
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • MacBook Pro Tiger I can not deselect mute button.

    MacBook Pro Mac OS X 10.4.11 I can not deselect mute button. On the profiler when I select VOLUME it sats no information found. How can I deselect the mute button?

    maxsurovi wrote:
    i brought a macbook pro, but i can not use my apple id.because its already register onther account.i couldnt found that person.i want reset that account,can tell me how can i do this?
    Restore the Mac to Factorty settings to make it Truly Yours.
    Note:
    This should have been done before you took possession...
    Apple What to do before selling or giving away your Mac
    http://support.apple.com/kb/HT5189?viewlocale=en_US&locale=en_US
    Also See Thomas Reed's How to Prepare your Mac for sale

  • Deselecting images in camera raw before opening the rest is deleting the files from finder!

    Hi, as the title suggests, im having an issue with of our machines. There are 6 running camera raw and it is the only one to do this (version 6.6).
    Example situation:
    10 RAW files are dragged into photoshop,
    they open in camera raw.
    all are selected and a white balance taken from the 'grey card' image that has been shot specifically.
    the grey card image is then deselected (with backspace button or otherwise) because i don't need it to be opened in photoshop for further editing with the rest.
    the problem:
    after clicking 'open images' the deselected grey card image is dissapearing from my finder window. the delay in opening in photoshop means i can actually watch it go.
    this doesnt happen on any other of my machines in the studio and that action should simply tell camera raw that i dont want to open that particular image in photoshop.
    can anyone tell me why it is doing that??
    we're working off our server (as we normally do), so the files arent being sent to the trash. if raws are worked on from the dekstop, the same thing happens and they obviously go straight to the trash then
    why is camera raw deleting my files? are they recovereable? how do i stop it?
    any help would be great. its a fast working studio and the grey card shots are not something we can afford to be losing.
    thanks,
    dom.

    Sounds like you're working over a network.
    This is the boilerplate text often used in connection to saving to a network (please NOTE the part where it explains that normally, it does work, but that it is impossible to troubleshoot someone else's network remotely, and that's why it's not supported by Adobe):
    If you are opening files over a network or saving them to a network server, please cease and desist immediately in the event you are currently experiencing problems with one or more files. Working across a network is not supported.
    See: 
    http://kb2.adobe.com/cps/406/kb406793.html
      Copy the CLOSED file from your server to your local hard disk, work on it, save it again to your local hard disk, close it, and copy the closed file back to the server.
         Of course, the fact that Adobe does not support working across a network does not necessarily mean it won't work.   It should.
        Adobe's position is that there are too many variables in a network environment for them to guarantee that everything will work correctly in every network, especially given the fact that if something does not work properly, it's probably the network's fault, and Adobe has no way of troubleshooting your network.
      If you can't work locally, you are on your own, and if something happens, you're on your own. If you must work from a server, make sure your network administrator is a competent professional.
    When problems arise, a lot of valuable work can be lost.

  • Problem with radio Button(urgent)

    hai friends
    (sub:- deselecting radio buttons(2 radio buttons) at a time. ie. no one is selected at any point of time. whenever he/she cliks it is going to select.)
    In my form, i have 2 radio buttons. if i click one radio button it opens one canvas and enter some data and when i press OK button there, it will come back to original canvas.at this movement selected radio button should be deselected.
    If i click 2nd radio button it also opens another canvas and enter some data and when i press OK button there, it will come back to its original canvas.at this movement selected radio button should be deselected.
    when come back to its original canvas, is there any chance of deselecting both radio buttons at a time. ie. at any point of time customer may select any one. no one is default . i need that methodology. it is possible? if so, give me code for it.
    regards
    madhava

    Hi,
    you can use a third radio button and set it to be invisible. Whenever you want your two visible buttons to be deselected simply set the value to your third button value.
    Achim

  • Buttons in panel gives error

    i created a class that has many buttons and each button calls something on a Canvas.
    but i keep getting errors.
    THE ERROR ARE
    C:\WINDOWS\Desktop\WINDOWS\pickdraw\ShapeButtons.java:36: local variable drawArea is accessed from within inner class; needs to be declared final
    drawArea.setShape(1);
    ^
    1 error
    THE CODE IS
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.*;
    import java.lang.String.*;
    import java.awt.Graphics.*;
    public class ShapeButtons extends Panel implements ItemListener
    Checkbox fill = new Checkbox("Filled");
    Choice sel;
    PickCanvas drawArea;
    Button rect, oval, poly, del, clear;
    public ShapeButtons(PickCanvas drawArea)
    this.drawArea= drawArea;
    sel = new Choice();
    add(sel);
    sel.add("selected");
    sel.add("deselected");
    rect = new Button( "Rect" );
    ActionListener lis1 = new ActionListener()
    public void actionPerformed( ActionEvent e )
    drawArea.setShape(1);
    rect.addActionListener( lis1 );
    oval = new Button( "Oval" );
    ActionListener lis2 = new ActionListener()
    public void actionPerformed( ActionEvent e )
    drawArea.setShape(2);
    oval.addActionListener( lis2 );
    poly = new Button( "Poly" );
    ActionListener lis3 = new ActionListener()
    public void actionPerformed( ActionEvent e )
    drawArea.setShape(3);
    poly.addActionListener( lis3 );
    del = new Button( "Delete" );
    ActionListener lis4 = new ActionListener()
    public void actionPerformed( ActionEvent e )
    drawArea.delete();
    del.addActionListener( lis4 );
    clear = new Button( "Clear" );
    ActionListener lis5 = new ActionListener()
    public void actionPerformed( ActionEvent e )
    drawArea.clearCanvas();
    clear.addActionListener( lis5 );
    add(rect);
    add(oval);
    add(poly);
    add(del);
    add(clear);
    add(fill);
    fill.addItemListener(this);
    getSel().addItemListener(this);
    getSel().select("deselected");
    public Choice getSel()
              return sel;
    public void setSelected(String s)
         getSel().select(s);
    public void itemStateChanged(ItemEvent e)
    if(e.getItemSelectable() == fill)
    drawArea.setFill(fill.getState());
    if(getSel().getSelectedItem().equalsIgnoreCase("selected"))
                   drawArea.setSelect(1);
         else if(getSel().getSelectedItem().equalsIgnoreCase ("deselected"))
                   drawArea.setSelect(2);
    IN THE PICKCANVAS I DO HAVE A METHOD WHICH IS:
    public void setShape(int action)
    this.action = action;
    AND I DECLARED ACTION IN THIS CANVAS AS int action;
    SO I DON'T KNOW WHAT'S WRONG. HELP.     

    drawArea is defined as a member variable of ShapeButtons, so normally it should be usable from an anonymous inner class as you are trying to use it. However, you have named a parameter of the constructor with the same name as the member variable. This means that when you use that variable name, you are referring to the local variable. If local variables are not final, then they cannot be used in inner classes defined within that function. You have three options:
    1) Rename the constructor parameter so that drawArea always refers to the member variable.
    2) Declare the constructor parameter final with the final keyword.
    3) Refer to the drawArea inside the inner classes using the 'qualified this' variable.
    The third option is the one I would use, the first being my second choice and the second option the last.
    Inside the inner class, 'this' refers to the instance of the inner class. You can refer to the instance of the outter class associated with that instance by prepending the name of the enlosing class with a '.' to the 'this' keyword. For example:
    public ShapeButtons(PickCanvas drawArea) {
        this.drawArea= drawArea;
        rect = new Button( "Rect" );
        ActionListener lis1 = new ActionListener() {
            public void actionPerformed( ActionEvent e ) {
                //ShapeButtons.this refers to instance of enclosing class
                ShapeButtons.this.drawArea.setShape(1);
    }I was being nice and I answered your question, but next USE CODE TAGS!!!
    E. West

  • Buttons in panel??

    i created a panel that has buttons. each button calls something to happen in a canvas. but this error appears.
    i did put a setShape on the Canvas so i don't know what's wrong
    THE ERROR IS:
    C:\WINDOWS\Desktop\WINDOWS\pickdraw\ShapeButtons.java:40: local variable drawArea is accessed from within inner class; needs to be declared final
    drawArea.setAction(r);
    ^
    C:\WINDOWS\Desktop\WINDOWS\pickdraw\ShapeButtons.java:40: cannot resolve symbol
    symbol : method setAction (int)
    location: class PickCanvas
    drawArea.setAction(r);
    ^
    C:\WINDOWS\Desktop\WINDOWS\pickdraw\ShapeButtons.java:51: cannot resolve symbol
    symbol : method setAction (int)
    location: class PickCanvas
    drawArea.setAction(o);
    ^
    C:\WINDOWS\Desktop\WINDOWS\pickdraw\ShapeButtons.java:61: cannot resolve symbol
    symbol : method setAction (int)
    location: class PickCanvas
    drawArea.setAction(p);
    ^
    4 errors
    THE CODE IS
    import java.awt.Graphics.*;
    public class ShapeButtons extends Panel implements ItemListener
    Checkbox fill = new Checkbox("Filled");
    Choice sel;
    PickCanvas drawArea;
    Button rect, oval, poly, del, clear;
    public ShapeButtons(PickCanvas drawArea)
    this.drawArea= drawArea;
    sel = new Choice();
    add(sel);
    sel.add("selected");
    sel.add("deselected");
    rect = new Button( "Rect" );
    ActionListener lis1 = new ActionListener()
    public void actionPerformed( ActionEvent e )
    drawArea.setAction(1);
    rect.addActionListener( lis1 );
    oval = new Button( "Oval" );
    ActionListener lis2 = new ActionListener()
    public void actionPerformed( ActionEvent e )
    drawArea.setAction(2);
    oval.addActionListener( lis1 );
    poly = new Button( "Poly" );
    ActionListener lis3 = new ActionListener()
    public void actionPerformed( ActionEvent e )
    drawArea.setAction(3);
    poly.addActionListener( lis3 );
    del = new Button( "Delete" );
    ActionListener lis4 = new ActionListener()
    public void actionPerformed( ActionEvent e )
    drawArea.delete();
    del.addActionListener( lis4 );
    clear = new Button( "Clear" );
    ActionListener lis5 = new ActionListener()
    public void actionPerformed( ActionEvent e )
    drawArea.clearCanvas();
    clear.addActionListener( lis5 );
    add(rect);
    add(oval);
    add(poly);
    add(del);
    add(clear);
    add(fill);
    fill.addItemListener(this);
    getSel().addItemListener(this);
    getSel().select("deselected");
    public Choice getSel()
    return sel;
    public void setSelected(String s)
    getSel().select(s);
    public void itemStateChanged(ItemEvent e)
    if(e.getItemSelectable() == fill)
    drawArea.setFill(fill.getState());
    if(getSel().getSelectedItem().equalsIgnoreCase("selected"))
    drawArea.setSelect(1);
    else if(getSel().getSelectedItem().equalsIgnoreCase("deselected"))
    drawArea.setSelect(2);
    IN THE CANVAS I DID PUT THIS
    public void setShape(int action)
    this.action = action;
    AND I DECLARED AT THE BEGINNING OF THE CANVAS int action=1;
    WHAT'S WRONG WITH THIS PROGRAM??
    THANKS FOR ANY HELP

    The above code with code tags.
    import java.awt.Graphics.*;
    public class ShapeButtons extends Panel implements ItemListener
       Checkbox fill = new Checkbox("Filled");
       Choice sel;
       PickCanvas drawArea;
       Button rect, oval, poly, del, clear;
       public ShapeButtons(PickCanvas drawArea)
          this.drawArea= drawArea;
          sel = new Choice();
          add(sel);
          sel.add("selected");
          sel.add("deselected");
          rect = new Button( "Rect" );
          ActionListener lis1 = new ActionListener()
             public void actionPerformed( ActionEvent e )
                drawArea.setAction(1);
          rect.addActionListener( lis1 );
          oval = new Button( "Oval" );
          ActionListener lis2 = new ActionListener()
             public void actionPerformed( ActionEvent e )
                drawArea.setAction(2);
          oval.addActionListener( lis1 );
          poly = new Button( "Poly" );
          ActionListener lis3 = new ActionListener()
             public void actionPerformed( ActionEvent e )
                drawArea.setAction(3);
          poly.addActionListener( lis3 );
          del = new Button( "Delete" );
          ActionListener lis4 = new ActionListener()
             public void actionPerformed( ActionEvent e )
                drawArea.delete();
          del.addActionListener( lis4 );
          clear = new Button( "Clear" );
          ActionListener lis5 = new ActionListener()
             public void actionPerformed( ActionEvent e )
                drawArea.clearCanvas();
          clear.addActionListener( lis5 );
          add(rect);
          add(oval);
          add(poly);
          add(del);
          add(clear);
          add(fill);
          fill.addItemListener(this);
          getSel().addItemListener(this);
          getSel().select("deselected");
       public Choice getSel()
          return sel;
       public void setSelected(String s)
          getSel().select(s);
       public void itemStateChanged(ItemEvent e)
          if(e.getItemSelectable() == fill)
             drawArea.setFill(fill.getState());
          if(getSel().getSelectedItem().equalsIgnoreCase("selected"))
          drawArea.setSelect(1);
          else if(getSel().getSelectedItem().equalsIgnoreCase("deselected"))
          drawArea.setSelect(2);
    }

  • ABAP Web Dynpro, ALV, Cardinality 0..n, Remove Select/Deselect All

    Hi Everyone
    I am developing a new application using ABAP Web Dynpro. I am using ALV. I want to give the user the option to select either 0 or multiple rows in the ALV grid. However, I want to hide the standard Select All/Deselect All push button that appears in the top left hand corner. This is because we do not want the user to simply select all and then click on a pushbutton to complete the process. If they wish to do this, they must manually select each item first of all. Anyone have any ideas? I've looked at the underlying ABAP classes for WD4A, but cannot find a method to do this.
    Thanks in advance for your help!!
    Jon

    Hello,
    To hide the buttons that appear at the top left of ALV, do the following:
    lo_model->if_salv_wd_std_functions~set_edit_check_available(
        EXPORTING value  = abap_false )   .
      lo_model->if_salv_wd_std_functions~set_edit_append_row_allowed(
          EXPORTING  value  = abap_false )  .
      lo_model->if_salv_wd_std_functions~set_edit_insert_row_allowed(
        EXPORTING  value  = abap_false )   .
      lo_model->if_salv_wd_std_functions~set_edit_delete_row_allowed(
        EXPORTING  value  = abap_false )   .
      lo_model->if_salv_wd_std_functions~set_pdf_allowed( abap_false ).
      lo_model->if_salv_wd_std_functions~set_view_list_allowed( abap_false ).
    lo_model->if_salv_wd_std_functions~SET_EXPORT_ALLOWED( abap_false ).
    Hope this helps!
    Regards,
    Srilatha

  • Using pen button to scroll / pan with default drivers

    Hi all,
    On a previous tablet pc I owned, I was able to set the pen button to be used to scroll / pan instead of right click. Using the default Lenovo drivers, I see an option to deselect "use pen button as right click", but I don't see where I can instead choose the scrolling option. Does that require the Wacom drivers to be installed? I'm trying to avoid that, since I don't need pressure sensitivity much and I seem to be the only person on this forum whose pen + touch isn't giving me problems, so don't want to unnecessarily change drivers. 
    Thanks!

    You need to test what the SelectedIndex is before you add or subtract 1 from the SelectedIndex.
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    'move up through the items
    If ListBox1.Items.Count > 0 Then
    If ListBox1.SelectedIndex <= 0 Then
    ListBox1.SelectedIndex = ListBox1.Items.Count - 1
    Else
    ListBox1.SelectedIndex -= 1
    End If
    End If
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    'move down through the items
    If ListBox1.Items.Count > 0 Then
    If ListBox1.SelectedIndex = ListBox1.Items.Count - 1 Then
    ListBox1.SelectedIndex = 0
    Else
    ListBox1.SelectedIndex += 1
    End If
    End If
    End Sub
    If you say it can`t be done then i`ll try it

  • Workaround for keyword button sets bug

    Thought I'd post this in case anyone else is beating their head against a wall trying to use custom keyword button sets.
    BUG: Control bar sometimes displays the wrong captions for the keyword buttons. Cause: Deselecting a keyword button set in the "Edit buttons" dialog will cause any active button sets after it to appear corrupted in the control bar. For example, with the default set of "Photo Descriptors, People, Stock Categories, Snapshots, ..." try unchecking the Stock Categories button set. When you return to the control bar, use the popup button set selector (just under "Add Keyword") to select Snapshots. Instead of the Snapshot keyword buttons, you will instead see the button captions from Photo Descriptors, though if you click one of those buttons, it will apply the appropriate keyword from the Snapshots set.
    Workaround: Rearrange the order of the button sets list in the Edit Buttons dialog to make all checked button sets appear before all unchecked button sets. In other words, don't have any gaps where you have an unchecked button set followed by a checked button set.
    Cheers,
    Paul

    You are my hero!!!! This is exactly what I was looking on here for. Thanks again.

  • Allow doClick() on buttons, but not from mouse

    Hi all,
    I have an odd situation:
    I have a drawing tool with a bunch of JButtons. When users click a button, the button is selected, any currently selected button gets deselected (using the button's doClick() method). Also, certain events in my program use the button's doClick() method.
    However, what I DON'T want is for users to UNCLICK a button by themselves. So if a user clicks an already selected button, I want nothing at all to happen.
    I'm not sure how I could do this, however, as I don't even know where I'd catch the clicking event (since JButton handles that itself). I don't want to set the button to be disabled, because other events in the program ought to be able to access the JButton.
    Any ideas would be greatly appreciated,
    Thanks!

    I suppose you could call it an algorithm. If
    clicked button != selected buttonMy problem is that I can't see any way to differentiate between the clicked button and the selected button. When the user clicks a button, it's the JButton's event handler that deals with the selection (or something like that), and so the button gets selected before I can do anything.
    For instance, if I add a little error in one of my button listeners, so I can get a stack trace from the clicked event, I get this stack trace:
    Exception in thread "AWT-EventQueue-0" java.lang.ArithmeticException: / by zero
         at org.concord.graph.examples.GraphWindowToolBar$1.actionPerformed(GraphWindowToolBar.java:246)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:269)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
         at java.awt.Component.processMouseEvent(Component.java:5554)... and so on up to the EventDispachThread. I don't understand at what point I could put in code such as "If clicked button != selected then select button, otherwise don't" because it seems as if the button is already selected before I get a chance to do that.

  • Custom Button Widths

    When I replace auto menu buttons with custom PSD images, and want to remove Muse SHow Items, the menu defaults to Uniform Size. Even if I deselect Edit Together, button widths are uniform. Adjusting Scale to Fit or Scale to FIll has no effect.

    Have you tried changing to uniformed spacing?

Maybe you are looking for

  • Use of EXIST clause

    Need to seek advice on the use of EXISTS clause. What is this statement trying to do? What is the '1' in the inner SELECT statement means? DELETE FROM a WHERE NOT EXISTS (SELECT 1 FROM b WHERE a.a_id = b.a_id); What about these 2 statements doing?? S

  • I just installed CC Lr 5.5 and it will not open on my laptop but works fine on my desktop.

    I just installed CC Lr 5.5 and it will not open on my laptop, but works fine on my desktop.

  • Bluescreen Error with Crash from Grafikcard 3D Hardware Speed

    At first sorry for my bad English. I have since Flash Player Vision 10 a Problem. If I would see a Video in You Toub or a other Homepage my Computer crashs with a Blue Screen. Then my Computer Starts new. I´m looking for the problem since a few weeks

  • No Player Controls

    Hi guys I'm using Captivate 3 and when I publish, there are no player control bar. its works fine in the preview. Any ideas? Many Thanks Graham

  • Not able to install application

    Hi  Am facing a problem in z10 blackberry link desktop manager not able to install the application like (.cod or .alx) files  please help me out i have tryed using a apploader but it is giving an error  "You need to use the BlackBerry(R) Desktop Soft