How can we show a button pressed?

Hi friends!
I want to show the JButton pressed even when i had removed the mouse pointer after clicking it. i.e. the button should not look embosed after it has beeen clicked ,it should look pressed.

I think you should use JToggleButton instead of JButton.
"Remember JToggleButton retains it's state after it is clicked"

Similar Messages

  • How can I leave a button pressed?

    Hello, world...
    I need to be pushed a button after I selected it. In other words, I want the button remains down...
    Please, help me...
    Emiliano.

    Hi, Ned Murphy...
    First...Happy New Year...
    I tried your advice but it doesn't work...
    I wrote:
    import fl.controls.Button;
    private var Btn1:Button;
    Btn1 = new Button ();
    Btn1.move(160,135);
    Btn1.setSize(30,30);
    Btn1.label = "S";
    Btn1.addEventListener (MouseEvent.CLICK,select);
    addChild (Btn1);
    private function select (e:MouseEvent)
                Btn1.upState = Btn1.downState;
    I have these errors:
    1119: Accesso a una proprietà non definita downState mediante un riferimento con tipo statico fl.controls:Button.
    1119: Accesso a una proprietà non definita upState mediante un riferimento con tipo statico fl.controls:Button.
    I'd like to have 3 Buttons. When I press one of them it is held down and the other two remain up.Only one Button can be pressed for time...
    I can't use RadioButtons because I have problems with FMS using them (when I load this .swf into another .swf, I can see only the RadioButton.label but not the RadioButton itself, like you can see from the image attached)...
    Please, help me...
    Emiliano.

  • How can I make a button that on press the object appears and on second press the object to disappear

    Hello,
    I'm quite new to flash programing, and I don't know how can I make a button that will make the object appear and disappear.Till now I have this code for the appear:
    on (press)
        _root.top1.gotoAndStop(2);
        _root.topp.gotoAndStop(2);
        _root.mm1.gotoAndStop(2);
              _root.m1.gotoAndStop(2);
    but from here I'm stuck.
    Thank you for your help

    What you can do is use the _visible property of the object to make it appear and disappear, or more correctly, use the opoosite of the _visible property.  You should not put code "on" objects, keep it in the timeline.
    If "object" is the instance name of the object you want to toggle, then in the timeline code you can use...
    object._visible = false;  // start with the object being invisible
    yourButtonName.onRelease = function(){
        object._visible = !object._visible;
    That one line in the function sets the object's _visible property to be the opposite of what it currently is.

  • How can i initialize a button (Switch when pressed) to be always disabled when i start the programm.

    Hello
    How can i initialize a button (Switch when pressed) to be always disabled when i start the programm. My problem is that the state of the button is always the state in which it finihed last time.
    Thanks
    Lukas

    A button is either true or false. "Disabled" is a property that determines if the button can be operated or not.
    It seems from the rest of your question that you actually want to ensure that it is set to false, but remain enabled. This is easiest done with a local variable as already mentioned by becktho.
    If you want to disable the button, use a property node.
    LabVIEW Champion . Do more with less code and in less time .

  • How can i show 2 videos at once imovie09?

    How can i show 2 videos at once using imovie 09?

    camro1050 wrote:
    Yes I mean 2 video side by side. How do I do that in iMovie 11?
    From iMovie Help:
    To add a side-by-side clip:
    Make sure Advanced Tools are turned on.
    Open the project you want to add the side-by-side clip to so that it’s showing in the Project browser.
    In the Event browser, select a video clip or a frame range that you want to use as a side-by-side clip, and then drag it over a clip in your project.When you see the green Add symbol, release the mouse button.
    In the contextual menu that appears, choose “Side by Side.”In the Project browser, the side-by-side clip appears with a blue border around it above the video clip you added it to, at roughly the spot where you added it (toward the beginning, middle, or end of the clip).
    Depending on the length of the side-by-side clip you added, it may extend beyond the clip you added it to (only if there’s another clip after the clip you added the side-by-side clip to). You can drag the split-screen clip so that it begins at a different point in the main clip. To reposition where the split-screen clip appears in the project, drag it to a different clip.
    Play back the effect by placing the playhead (the red vertical line) anywhere before the side-by-side clip in the Project browser, and then pressing the Space bar.Press the Space bar again to stop playback.
    John

  • How can I use the button in one panel to control the other panel's appearing and disappearing?

    How can I use the button in one panel to control the other panel's
    appearing and disappearing? What I want is when I push the button on
    one button . another panel appears to display something and when I
    push it again, that the second panel disappears.

    > How can I use the button in one panel to control the other panel's
    > appearing and disappearing? What I want is when I push the button on
    > one button . another panel appears to display something and when I
    > push it again, that the second panel disappears.
    >
    You want to use a combination of three features, a button on the panel,
    code to notice value changes using either polling in a state machine of
    some sort or an event structure, and a VI Server property node to set
    the Visible property of the VI being opened and closed.
    The button exists on the controlling panel. The code to notice value
    changes is probably on the controlling panel's diagram, and this diagram
    sets the Visible property node of a VI class property node to FALSE or
    TRUE to show or
    hide the panel. To get the VI reference to wire to the
    property node, you probably want to use the Open VI Reference node with
    the VI name.
    Greg McKaskle

  • How can I make my buttons be gone forever?

    Just starting out with Flash and have run into a problem. I have several scenes with buttons that can be pressed once and then they disappear using:
    myBtn1.onRelease = function(){ this._visible=false}
    But when I go back to the scene the buttons reappear. How can I make my buttons be gone forever?

    if you have more than 1 button that should be made not visible at any given time, you'll need to use an array to store those button references.  otherwise, you can use:
    var alreadyRemoved:Boolean;
    if(alreadyRemoved){
    myBtn1._visible=false;
    myBtn1.onRelease=function(){
    this._visible=false;
    alreadyRemoved=true;

  • How can I show TOOL display on tool bar?

    How can I show TOOL display on tool bar?

    I have looked around, but I cannot find anything to make the Tools button appear or disappear.
    Last two ideas I have:
    sign in with your Adobe ID
    uninstall Reader using http://labs.adobe.com/downloads/acrobatcleaner.html then reinstall the latest version (11.0.10 or 10.1.13)

  • How can I show additional tab rows when using many open tabs?

    How can I show additional tab rows when using many open tabs?

    What method (code) did you use to get the Tab bar displaying in the space used for the Navigation Toolbar (location bar)?
    The Tab bar should be displayed above the Navigation Toolbar.
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • How can I show all of my keywords in iPhoto.  there seems to be a limit on the number that can be used.

    How can I show all of the keywords used in iPhoto.  There seems to be alimit on how many can be displayed.

    When I click the "Edit Keywords" button, I get a list of all keywords. I just added several hundred random keywords, and they are all visible, when I scroll the list in "Edit Keywords" view.
    Have you the scroll bars hidden? You can enable the scroll bars in the System Preferences > General tab:   enable "Show Scroll bars - always".

  • How can I get next button in preview app

    Hi,
    How can I use next button in preview app. Means in one folder I have 10 photos and I want to open each photo to view in preview app. Or any other options to use the next button , plz help
    Yas

    If you open all 10 at once in Preview, they will open together and there will be a filmstrip along the side for navigation.
    Or, if you select all 10 in the Finder and simply open QuickLook (File/QuickLook or press spacebar shortcut), you will see Previous/Next buttons in the top left corner without having to open any programs.

  • How can I show code here?

    Hello,
    Im new on this board. First off all:
    How can I show java code here (eg. by tag)?
    Thanks

    click the code button on the dialog then past your code between the tags.

  • How can we show data in rows when it is in Columns........

    I have strucked with a simple but a complex problem.
    I have a Report with data in vertical rows..need of the hour is how can we show that data into column structure.
    here is the table sample which i have in Database..
    Location      chrg_type    Effective_date
    xxxxxxx        xxxx          xx-xx
    thhis is the structure in effective date we have several months in it in a single column i want show the effective date or effective month in various columns instead of a single column.
    my required table is....
                                Effective_date     Effective_date
    Location      chrg_type     xx-xx              xx-xx
    xxxxxxx        xxxx          xx-xx
    any tough heads?????

    Hi Sunil,
    Your 1st problem is that you are going to need one more field to accomplish you goal. What type of data do want under your new date columns?
    Anyway, once you have that you need to move on to how to move the data out into columns based on date.
    Try something like this.
    0_Date = IF DATEPART('m',{tbl.Effective_date}) = DATEPART('m',CurrentDate) AND
    DATEPART('yyyy',{tbl.Effective_date}) = DATEPART('yyyy',CurrentDate)
    THEN {tbl.DataField}
    1_Date = IF DATEPART('m',{tbl.Effective_date}) = DATEPART('m',DATEADD('m', -1, CurrentDate)) AND
    DATEPART('yyyy',{tbl.Effective_date}) = DATEPART('yyyy',DATEADD('m', -1, CurrentDate))
    THEN {tbl.DataField}
    2_Date = IF DATEPART('m',{tbl.Effective_date}) = DATEPART('m',DATEADD('m', -2, CurrentDate)) AND
    DATEPART('yyyy',{tbl.Effective_date}) = DATEPART('yyyy',DATEADD('m', -2, CurrentDate))
    THEN {tbl.DataField}
    ... Repeat this process until you have all of the columns you need, following this format.
    Hope this works for you,
    Jason

  • Forms 6.0-- How can I show records in a block in different colours.

    In a multi record block, how can I show few records in one colour and few more in a different colour depending on a condition.

    Use DISPLAY_ITEM.
    This will change the visual attribute of the item in the current(!) record,
    set_item_property changes the attributes of the item in all(!) records.

  • How can you make one button preform different actions in Xcode?

    How can you make one button "preform a click" and "orderfront"? Is that possible? Because what I am doing is making a welcome window to my application for Mac OS X 10.6, and I have two buttons in that window, one says "Connect" which connects a a WebView to a url and the other button opens up the main window. So how can I a make a button do multiple things at once??

    Ah - If you are just using bindings between various objects from Interface Builder, you can reduce your application code a bit (sometimes quite a bit), but there is only so far you can go. Typically variables and routines are defined in your application that Interface Builder hooks into, so that your application code (usually Objective-C, but can be others) can use these variables and routines to determine what is happening in the user interface.
    I'm not sure how up-to-date the project code is (or what programming code you are familiar with), but you can take a look at Apple's Cocoa Application Tutorial to see what is (usually) involved in creating an application.

Maybe you are looking for