Buttons without pressed down colour

In currently working on a program for which I need buttons without decorations. I succeed in removing most of the effects: the borders, the 3D-effects are replaced by colours etc. The only problem that is left is the fact that when I press the button it changes colour. I've been searching for a way to do so, but I didn't find a way to solve the problem:
The button still needs a background colour, so that means I can't just make it transparant, and I can't do it using look and feel because that seems to change ALL of the buttons (and I also use some normal ones apart from the 'stripped' buttons).
Is there a way to change the down state of a JButton without having to truly make a new object that extends the AbstractButton? And if there really is no other way, could someone point me in te right direction on how to make such an extention? (I know how to make extended objects etc, but I'm quite new to using Swing etc and haven't found how to make such things)
Greetings,

Sorry BaltimoreJohn, I completely missed your post!
Yes, as you said, b JLabel is probably the answer. But don't implement mouseClicked() - you should actually use the other four methods of MouseListener to handle button presses. Reason being that mouseClicked() will only work if the cursor is perfectly stationary in between the press and release.

Similar Messages

  • Move files without pressing down the trackpad in Lion

    I just got my new 13" Macbook Air but can't move files (or windows) by "double clicking and holding" the way I could on my old Macbook Pro. In order to move something I need to press down the trackpad, or use three fingers on it. Did Apple remove this option with Lion or how do I make it work?

    BEAUTIFUL!!!! HERE IS A MORE SIMPLER APPROACH
    If you want to reactivate the classic double-tap-and-drag gesture, it's possible, but the option is well-hidden. Instead of being in System Preferences under Trackpad, it's actually under System Preferences > Universal Access > Mouse and Trackpad > Trackpad Options. Click the check box that says "Dragging" and you should be all set.

  • Menu buttons without draw-down menus

    I need help…
    I have a client that is adamant, refusing draw-down menus in the navigational buttons.
    So I laid out a page where there are 6 navigational buttons across the top, then on the left side I added 7 buttons (lozenge shapes) going down.  So all together I have approx 13 links / pages. Based on the top navigational buttons there are 6 pages. How can I create 7 additional individual pages without affecting the 6 original navigational buttons. Is that possible?
    Thank you!
    sal

    Anshul,
    Here's something similar of what I have in mind.
    How can I link the side buttons to the pages "test 1, tast 2... etc.?

  • I want to remap my macbook function buttons without pressing fn

    Hi
    I have a new MBP
    I have unchecked the box that lets me use function keys for other than their original purposes
    So now I can use e.g. my last volume button to work instead as a Mission Control / Show desktop function that is really useful for me as I have one funcitonal hand.
    However I'd like to remap or reassign the function buttons. For example my F1 F2 now do nothing - I could assign them to certain other  functions, but I'd like to assign them back to screen brightness.
    Is there a way I can do this?
    And is there a way i can consign the dashboard to the bin, and use that button for something thats actually useful ?
    (Sorry for the repost, I accidently placed it first in a macbook forum)
    Thanks,
    tom

    You can install this into OS X and access the files on Windows side and transfer them to a external drive.
    http://ntfsmounter.com/
    You can also use Winclone to clone Windows (from OS X) to a external drive.
    Once you got a copy of your files off both partitions...
    You can insert the OS X disk of the OS your using into the computer and reboot holding c
    On the second screen you have the option to reinstall OS X (and bundled apps) overwritting what you already have. Your files, account's and third party programs should remain though.
    Use the uninstaller of the program to remove it.
    If you want to erase everything in your OS X partition you can use Disk utility from the installer disk, it's under the Utilities menu in the Installer.
    If you accidentially select your hard drive you can erase both partitions.

  • IPhone 5 screen locking without pressing the lock button

    Recently my iPhone screen has started locking without pressing the button. It is like it is stuck but the button isn't even pushed down. It does it so often that it is hard to use my phone because it keeps locking the screen and then trying to turn off the phone. It wasn't so bad at first and I used the accessibility feature to lock my screen in case something was wrong with button. However, my friend was looking at my phone and pressed the lock button which made it start going crazy again. I can't turn my phone off either because it will automatically turn back on because the button is going off. It is almost like there is a ghost pressing my lock button constantly. That is the best way to describe it. I'm not sure if I am under warranty or not, I got the phone from Sprint in the beginning of June.

    Make an appointment at the genius bar and have it looked at. It sounds like the power button is failing.

  • Safari will lock up on my MacBook Pro. Force quit doesn't help. When I try to restart the computer, I get an error saying Safari cancelled the restart. I have to press the power button to shut down the computer.

    While I'm using safari,  it will freeze up. When I force quit safari and reopen it, I find that I'm back to where I was when I did the force quit and safari remains locked up. When I try to restart the computer, I get a pop up that says that safari cancelled my restart. I then press the power button to shut down the computer. When I reboot the computer and open safari, I see all the tabs and windows that were opened when this issue began, only this time safari isn't frozen. This problem started yesterday.
    Has anyone experienced the same problem? Is there a fix for this problem?

    Try Resetting Safari: Open Safari. Cick on the name Safari in the menu bar. In the drop down menu click Reset Safari.

  • So I have an iPad with the smart cover, and it's usually supposed to turn on the iPad when u open it, but it's no doing that for me. Nor is it turning off without pressing the button. What is the meaning of this?

    So I have an iPad with the smart cover, and it's usually supposed to turn on and off the iPad when u open it and close it, but it's not turning on for me. Nor is it turning off without pressing the button. What is the meaning of this?what caused it to be this way? Is there someway that I could fix it?

    Wait a sec did this just start?
    You set up the smart cover function in settings (you did that, right?) so, if you did that and it's failed you make an appointment at your nearest Genius Bar now.

  • Touch Events: How can I check for a button being pressed while another button is being held down?

    Hello,
    I'm trying to check for a button being pressed while another is down through Touch.  In my case, I' m making a game and I need for a button to make the character jump.  However, when I hold down right, I notice that the jump button becomes somewhat unresponsive and I have to press it twice or more to get it to trigger, as opposed to just pressing the jump button by itself with nothing held down which works fine.  I'm testing this on my Motorola Droid 2.
    Here is some of my code that demonstrates text instead of my character moving around:
    package  {
         import flash.events.TouchEvent;
         import flash.ui.Multitouch;
         import flash.ui.MultitouchInputMode;
         public class Document extends MovieClip {
               Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
               private var controls:BottomBar;
               private var debugText:String;
               public function Document() {
                    addIngameGUI();
               private function addIngameGUI(){
                    controls = new BottomBar();
                    controls.y = stage.stageHeight - controls.height;
                    addChild(controls);
                    controls.aBtn.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
                    controls.bBtn.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
                    controls.leftArrow.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
                    controls.rightArrow.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
             private function testBtns(event:TouchEvent){
                   debugText.text = event.target.name;
    What am I doing wrong?  Is there a better approach?
    Thank you in advance.

    Hello,
    I'm trying to check for a button being pressed while another is down through Touch.  In my case, I' m making a game and I need for a button to make the character jump.  However, when I hold down right, I notice that the jump button becomes somewhat unresponsive and I have to press it twice or more to get it to trigger, as opposed to just pressing the jump button by itself with nothing held down which works fine.  I'm testing this on my Motorola Droid 2.
    Here is some of my code that demonstrates text instead of my character moving around:
    package  {
         import flash.events.TouchEvent;
         import flash.ui.Multitouch;
         import flash.ui.MultitouchInputMode;
         public class Document extends MovieClip {
               Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
               private var controls:BottomBar;
               private var debugText:String;
               public function Document() {
                    addIngameGUI();
               private function addIngameGUI(){
                    controls = new BottomBar();
                    controls.y = stage.stageHeight - controls.height;
                    addChild(controls);
                    controls.aBtn.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
                    controls.bBtn.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
                    controls.leftArrow.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
                    controls.rightArrow.addEventListener(TouchEvent.TOUCH_BEGIN, testBtns);
             private function testBtns(event:TouchEvent){
                   debugText.text = event.target.name;
    What am I doing wrong?  Is there a better approach?
    Thank you in advance.

  • How to open a Website in app automatically (without pressing button)

    I want to load a Website automatically into a page in my app without pressing a button (autoload). How can I do this?

    Web Content overlay lets you display a web page within a view area. Users can see the web page content in the view area without having to display a separate in-app browser. You can specify a web URL or a local HTML file.
    If you specify a local HTML file, make sure that the .html file and associated files and folders appear in the same folder. When the article content is created, all the files in the same folder as the .html file are uploaded.
    For any URL that gets redirected to a mobile URL automatically, specify the mobile URL (such as http://mobile.twitter.com/), not the original URL (such as http://twitter.com).
    Laxman

  • Is there any add on which i can reload all tabs from offline mode to online immediately without press the resend button in each tab?

    Hello to everyone!
    I want to ask if there is any add on to firefox which I can reload all tabs from offline mode to online mode immediately without press the resend button for each tab all the time.

    is it illegal to record a conversation without the other caller knowing?
    That depends on where you are... In the state of New Jersey, where I live, I believe that it is legal to record a conversation if at least one party to that conversation knows that it is being recorded, and there is no legal duty to inform the other party that the conversation is being recorded.
    This means that I could legally record all conversations I have with other people within the state of NJ, and likewise anybody whom I call or who calls me can record out conversations. However, it would be illegal for a third party to record out conversation without our knowledge and consent.
    Now the situation becomes more complex if I call somebody, or somebody calls me, across state lines... I've not made a study of the laws in every state, but I would not be surprised if there are states where both parties must give consent for the conversation to be recorded. This is probably the reason for the announcement "your call may be monitored and recorded for quality purposes" at the beginning of every call to customer support... 
    Wikipedia has a useful introductory article, and a quick Google search turns up much more information.
    http://en.wikipedia.org/wiki/Telephone_recording_laws
    http://www.google.com/search?q=legality+of+recording+telephone+conversations&ie=utf-8&oe=utf-8&safe=...
    K..

  • All of a sudden i'm getting this pop up box saying 'could not complete your request.  File is locked. '  Did i mistakenly lock the file by pressing a button without realizing it?

    all of a sudden i'm getting this pop up box saying 'could not complete your request.  File is locked. '  Did i mistakenly lock the file by pressing a button without realizing it?

    >> "NSDArray...[numbers/letters]".
    That's an error from the OS leaking into Photoshop.  It is due to a bug in MacOS 10.10 that occurs in the open and save dialogs (which are controlled by the OS). Apple is aware of this and working on solutions.
    Some people have had luck changing the view in the open/save dialogs to grid view or list view.

  • My projects icons turned to orange in Aperture? I must have pressed a button without noticing it. What does that mean, and how can I get them back to normal?

    My projects icons turned to orange in Aperture? I must have pressed a button without noticing it. What does that mean, and how can I get them back to normal?

    My projects icons turned to orange in Aperture?
    Ana Candano, what is your Aperture version? Earlier Aperture versions - until Aperture 3.2.4 had colored icons, Aperture 3.3 and later are gray in gray. Do you have two versions of Aperture installed?
    When you post back, list your version of MacOS X and the versions of any Aperture.app you can find with Spotlight on your Mac.
    Frank, the thread you pointed to, was a different question, but probably is related. It would be good to know how it has been resolved.

  • MacBook shuts down immediately both when power button is pressed and when lid is closed

    Hey there,
    The mentioned issues have happened to me for a couple of years or so. Specifically, when I press the power button it shuts down right away along with a click. Same happens when it sleeps; the light starts glowing and before a full seconds passes, I hear the same click and it shuts down. It started around the same time my battery died out of nowhere so I always attributed it to that. Now I got a new battery and it's still there. I tried resetting the SMC with both methods. The built-in keyboard had coffee spilled on it years ago so it doesn't really work, but I tried the key combination anyway. It didn't fix the problem, so I tried unplugging the battery and holding the power button. That didn't work either. What could be causing this issue?
    Thank you.

    Your problem is way more complex, here's my standard answer:
    "Whenever a liquid spill occurs the first thing that has to happen is the laptop should be shut down immediately. All power must be removed as soon as possible. It is especially important that the battery be disconnected and removed.
    All affected parts must be removed from the laptop. No attempt should be made to start/restart the computer since this could potentially damage the logic board beyond all repair.
    Then all affected parts would be washed in deionized water and blown dry with compressed air. (In a water spill the deionized water is probably not as critical. Depends on the mineral content of the water.) and blown dry with compressed air.This is especially true of the large chips on the logic board. Water can wick under them and cause havoc.
    The logic board should be placed in a drying/dehumidifing oven for at least two days. Longer depending on the spill.
      The keyboard is a separate matter."
    Also red wine would be one of the worst things you could spill on your computer.

  • My macbook doesn't work. After pressing down the power button I hear the sound from starting the apple symbol appears and after a while a sign prohibited appears on the place of the apple symbol

    My macbook doesn't work. After pressing down the power button I hear the sound from starting the apple symbol appears and after a while a sign prohibited appears on the place of the apple symbol

    Hi Kappy Thanks for your answer. I did a reboot on my Macbook as suggested and this operation is going on non stop for 14 hours and on the screen always appears the same message that you can see in the picture in attachment. Any ideas?

  • My sleep/wake button just all of the sudden started being sticky. It is still responsive but is difficult to press down. What should I do?

    My sleep/wake button just all of the sudden started being sticky. It is still responsive but is difficult to press down. What should I do?

    There isn't much you can do to try and clean/service that button so best thing to do is take it to an Apple genius bar and have them check it out and see about repair or cleanng whatever they recommend.

Maybe you are looking for