Different button press behavior in Java 5 and 6

Hi,
I upgraded the Java version from 5 to 6 and recompile my GUI application. All things look good except when I press a button that I set the ContentAreaFilled as false, the behavior is different.
I have pasted my code of creating the button below. Using the same piece of code, in Java 5, I could see the button is "lowered" when pressed. While in Java 6, it is just like pressing an icon or a lable.
Would anyone know in Java 6, what could I do to retain the "lowered" behavior when pressing a button but I can still do setContentAreaFilled(false)?
JButton cancelButton = new JButton("Cancel");
cancelButton .setFocusable(false);
cancelButton .setBackground(Color.RED);
cancelButton .setContentAreaFilled(false);
cancelButton .setOpaque(true);
cancelButton .setForeground(Color.WHITE);
cancelButton .setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED, new Color(0xFF, 0x33, 0x00), new Color(0x66, 0x00, 0x00)));
cancelButton .setBorderPainted(true);
cancelButton .setFont(new Font(ViewConst.DEFAULT_FONT_NAME, Font.PLAIN, 10));
Thanks and regards,
Scott

Works fine for me. Don't give it a custom Border.
If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

Similar Messages

  • Different print mode behavior between 1.5 and 1.6.

    We recently upgraded to 1.6. There seems to be some behavior that is working differently now(no other changes made).
    Here is the situation:
    I have a tabular report of projects with a link column that allows the user to go to a page of each project's detail. The column link has a passed in P50_PROJECT_ID that the detail select uses. The detail page has some general project detail information like name, project manager and this is displayed as items in an HTML region. The items are populated by a process that fires before header and selects the information INTO the item variable(:P50_PROJECT_NAME, :P50_PROJECT_START_DATE...etc). There are also two tabular reports based on SQL queries to display milestones and issues for the project. These are based on queries that have the WHERE clause using the incoming :P50_PROJECT_ID.
    On the detail page, and all other pages in the app, I have a Print navigation bar entry. This navigation entry target type is "Page in this application" and Page is &APP_PAGE_ID. Printer Friendly is checked on.
    The app was built with 1.5 and when the user went to the project detail page and clicked the Print link, it worked fine and showed all the data. After we converted the APP to 1.6, after the user selects the PRINT nav item, the page is re-invoked and the detail data shows up fine but the tabular reports show with NO DATA.
    It looks like I can fix this by changing the Print navigation bar item to SET P50_PROJECT_ID with &P50_PROJECT_ID and it works fine but I'm not sure that's the way to do it since the PRINT nav item is used on many pages(that may not use the P50_PROJECT_ID) and I'd like to know if there is a reason it's not working now and worked before?
    Any input is appreciated!
    Thanks,
    Paul

    Hi,
    I haven't used Java 6 yet, so I don't know about the performance improvements, but I don't find it strange.
    Calculations using floating points can give different results in different VM versions and on different platforms. You should declare the class to use strictfp if you want to get the same result on all implementations (that is of course slower)
    http://en.wikipedia.org/wiki/Strictfp
    Kaj

  • ThinkVantage button startup behavior changes after Rescue and Recovery

    I recently bought a Thinkpad X301 (2777-CTO). When booting my computer, I see the following message: "To interrupt normal startup, press the blue ThinkVantage button". Initially, when I press this ThinkVantage button on startup, I get a "Startup Interrupt Menu", pictured at http://img90.imageshack.us/img90/4773/startupinterruptmenu.png
    This menu is useful since it allows me to either enter the BIOS, start Rescue and Recovery, select a device to boot from, or simply start normally. However, after choosing the Rescue and Recovery option once, this menu no longer appears. Instead, it goes straight to Rescue and Recovery from there on without giving me the choice to enter the BIOS configuration or select a boot device.
    I find this new behavior problematic for a few reasons:
    - The behavior of the ThinkVantage button at startup is inconsistent (a menu that should appear no longer does after running Rescue and Recovery once).
    - There appears to be no straight-forward way of reverting back to the desired (original) behavior.
    - The initial prompt on the power-on splash screen is now misleading. Although it still says "To interrupt normal startup, press the blue ThinkVantage button"; the way the button acts, it would probably be more accurate to say "To start Rescue and Recovery, press the blue ThinkVantage button" instead.
    - This behavior breaks the "Option Keys Display" option in the BIOS setup. Although I enabled this option, which should cause the system to display which key does what (e.g., F1 for BIOS), this is not displayed.
    - Running Rescue and Recovery results in a loss of functionality (instead of simply restoring the system to the initial state).
    - And anytime I press the blue ThinkVantage button (as instructed) instead of F1 or F12, I end up wasting several minutes, waiting for Rescue and Recovery to finish booting before I can properly shut it down and try again.
    This problem appears to have existed for a long time (since 2008; http://forum.notebookreview.com/lenovo-ibm/241845-thinkvantage-boot-menu-boots-straight-into-rescue-... ). However, the only "solution" that I have found is just a workaround: avoid pressing the ThinkVantage button (as instructed by the power-on splash screen).
    The ideal solution would be to have a BIOS (or Rescue and Recovery) update which will prevent the ThinkVantage button from losing its original function after running Rescue and Recovery. I know that this is a minor bug, but this bug and another BIOS bug (in the network boot order menu, which I'll post after this one), which arose in less than a week after I received the computer, makes me question the ThinkPad's reputation for high-quality engineering.

    ThinkPad
    Service and Troubleshooting Guide
    Finding information with the ThinkVantage button
    The blue ThinkVantage button can help you in many situations when your
    computer is working normally, and even when it is not. Press the
    ThinkVantage button to open the Productivity Center thinkvantage toolbox and get access to
    informative illustrations and easy-to-follow instructions for getting started and
    staying productive.
    You can also use the ThinkVantage button to interrupt the startup sequence of
    your computer and start the Rescue and Recovery

    in the windows environment it no longer opens productivity center it opens the toolbox if the toolbox is installed 
    Thinkpad R61 7733-1GU
    Thinkpad X61T 7762-54U
    Thinkpad X60T 6363-4GU
    Did a member help you today? Thank them with a Kudo!
    If a post answers your question, please mark it as an "Accepted Solution"!
    Regards,
    GMAC

  • HT2173 iMac late2006 17". When power button pressed, white light comes on and stays on but nothing else happens?

    As stated: our Mac won't turn on other than the white light on the bottom right.
    Read through the support page which suggests taking the back off ( and use internal power switch) as in owners manual section 4, however it's not in there.  At the bottom there is a couple of screws and a couple of star head screws, I'm guessing I need to undo these and possibly pull from the bottom.  Don't want to break it,
    Thanks
    Mike

    A steady LED light generally indicates that the computer is on and the display is asleep.
    Before you get inpatient and start taking out screws or trying to open it up, which is not an easy task on that model.
    Reset the SMC, as per > Resetting the System Management Controller (SMC)
    1. Shut down the computer.
    2. Unplug the computer's power cord.
    3. Wait fifteen seconds.
    4. Attach the computer's power cord.
    5. Wait five seconds, then press the power button to turn on the computer.
    Then run the AHT, as per > Using Apple Hardware Test

  • When button press it should validate item and open another popup window

    apex 4.2.1
    I am having difficulties on it please help.
    I have a report and link and it open a page (popup window ) and it has items say, :p2_item_no and :p2_Final_Date (Date) and button submit and cancel.
    this page has process that is fetced the data for some hidden items. for example. :p2_Last_date (hidden).
    all above work ok but when hit the submit button then :p2_final_date item should be validated with :p2_last_date item
    so if :p2_final_date < :p2_last_date then error else accept the date value and same time go to the page 3 (another popup window).
    so from same submit button it must control both action. first validate and if success then open another page (popup window).
    thanks for help!
    RI.

    You can create an item level validation of type PL/SQL Expression on the popup page opened from the report.
    The item you would create the validation on would be P2_FINAL_DATE and the pl/sql expression you would use would be:
    :p2_final_date >= :p2_last_date;--Keith                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • I bougnt my S5 a month ago and I am having two major issues.  The screen is very slow to respond.  When the screen is dark and I press the home button, it doesn't come on.  I have to press the button anywhere from 4-10 times and then it usually flashes on

    I bougnt my S5 a month ago and I am having two major issues.  The screen is very slow to respond.  When the screen is dark and I press the home button, it doesn't come on.  I have to press the button anywhere from 4-10 times and then it usually flashes on and back off.  It is very, very frustrating.  The other issue is that the battery drains very quickly.  I have called Verizon numerous times regarding these issues.  They tell me to do different things that never help.  We eventually did a factory reset and it still has the same issues.  Help!  It is a brand new phone and unfortunately I am in a new two year contract.  Ugh. Is there anyone out there who can help me?

    I have done that several times.  In fact, every time I call Verizon with my phone problems, they have me do the same things repeatedly.  I keep telling them I have already done them but they insist they are SURE it will work this time.  It never does.  After doing the factory reset and it still not working correctly, they act like they are confused, almost like I am lying.  I did what you suggested above on the slim chance it would work this time but it did not.  I bought two S5's that day and the other one works perfectly fine.  I know I got a bad phone.  Verizon just does not listen.  It is a bad phone.  I just want a new phone that works properly.  Is that too much to ask?  I bought a new phone that has been bad from day one.  Why oh why do I have to spend hours of my time on the phone, in the store, on the computer, trying to rectify this?  It shouldn't be this difficult!  Help please!!!

  • URL Branch with java script  target fails, but works as button press

    I have a java script that displays a "report is loading" message when the page's submit button is pressed via the optional URL redirect attribute of the button.
    Unfortunately, I had to remove the optional URL Redirect so that I could perform some computations and processes as a result of the button press.
    I tried to put the script link in a branch attached to the button, but it failed with the following error.
    ERR-1777: Page 11 provided no page to branch to. Please report this error to your application administrator.
    Restart Application
    After the branch to the java script, there is an unconditional branch to page 11.
    Any one encounter this issue before and, if so, is there a work around?

    Hi
    Can you not use a URL redirect on the button to call your Javascript function - the Javascript will display the message you want to display, then call
    doSubmit('request_name');
    ...to submit your page, picking up all your processes/computations etc
    You then need to define a branch on your page which is conditional on the value of REQUEST - in this case request would be 'request_name'.
    regards
    Andrew
    UK

  • How to cach enter button pressing in java 2D API

    hi guys,
    how to cach enter button pressing in java 2D API
    thanks
    siva

    thats input handling -> Belongs to AWT.
    Tip-> register an KeyListener and search for KeyEvent.VK_ENTER
    lg Clemens

  • JTree Button, Line and Java look and feel ?

    Hi all,
    I have 3 small problem with my JTree ..
    1) The 'expand' button size ...
    I set a different Icon for each node in a getTreeCellRendererComponent method (from a class that extends DefaultTreeCellRenderer )...
    The icon are 32x32 pixels.. .and the RowHeight and the Font have been changed too. .
    How to change the size of the expand button (+/-) near the text node ? Because on my JTree, the expand/collapse buttons are really small compare to the icon & row height.
    2) No line appear between the node ...
    I try to set the line style property with -> putClientProperty("JTree.lineStyle", "Angled"); in the JTree constructor OR in the DefaultTreeCellRenderer constructor .. but it doesn't work :/
    3) How to set a Java look and feel for my JTree (actually, I have a Windows look and feel ..)
    I know .. I have grouped 3 question in the same topic ...
    If anyone can help me on one of these subjects. .. Thanks !
    Regards,
    Didier

    So, the Problem 1) is solved ..
    About the Problem 2)
    I put the code UIManager.setLookAndFeel(new javax.swing.plaf.metal.MetalLookAndFeel()) in the main method, like
      //Main method
      public static void main(String[] args) {
        try {
          UIManager.setLookAndFeel(new javax.swing.plaf.metal.MetalLookAndFeel());
        catch(Exception e) {
          e.printStackTrace();
        new MainApplication();
      }But it only set a Java L&F on the spliter, and on the toolbar contained in my application... Any idea why the title bar is not changed too ?
    (The title bar stay with a Window$ XP L&F ...)
    About the problem 3)
    When I set the L&F->UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); then the lines appear .. ??!! .. if I set again the previous value UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); .. then the lines desappear ..

  • I have reached out  to this community as my Iphone display gone black and got the solution to keep home and power button pressed. It worked but I would like to know why it went black

    I have reached out  to this community as my Iphone display gone black and got the solution to keep home and power button pressed. It worked but I would like to know
    1. Why it went black and is there a permanent fix for this
    2.Will the IOS gets automatically updated as I feel the IOS was 5 when I got the phone in 2012 december
    3.Do you suggest 7.1 for Iphone 4

    1. There is no way of knowing. These things happen.
    2. The iOS only gets updated when you want it to be.
    3. You should always update to the latest iOS your phone will support. Apple do not write the updates to make your experience worse.

  • My mini ipod appears off and not respond to any commands when pressed the buttons to reset, apple logo appeared and then the apple support site and it shuts down. already tried all the steps, but none worked, and when I plug it into my computer it does no

    My mini ipod appears off and not respond to any commands when pressed the buttons to reset, apple logo appeared and then the apple support site and it shuts down. already tried all the steps, but none worked, and when I plug it into my computer it does not appear in the iTunes bar. what do I do?

    If MacKeeper corrupted the Recovery partition then even I underestimated its potential for damage. Garbage "cleaning" apps will cause misery but I have not found that the Recovery partition to have been affected by using MacKeeper or anything like it. I doubt that it did so, but I have learned not to underestimate the potential for such things to result in system corruption.
    Before concluding your Mac has a hardware failure, try booting OS X Internet Recovery by holding command option r on startup (three fingers). That will force your iMac to bypass the Recovery partition altogether, and convey the ability to create a new one.
    An Internet connection will be required (wired or wireless).
    At the Mac OS X Utilities screen, select Disk Utility. Select your startup volume (usually named "Macintosh HD") and click the Repair Disk button. Describe any errors it reports in red. If Disk Utility reports "The volume Macintosh HD appears to be OK" in green then you can be reasonably (though not completely) assured your hard disk is in good working order.
    Assuming the HD remains usable you can then use Disk Utility to erase it. Reinstall OS X, restore your essential software and other files, and don't reinstall the junk.

  • My apps are not being updated when pressing the update all button. It just says installing and no update is being done., my apps are not being updated when pressing the update all button. It just says installing and no update is being done.

    my apps are not being updated when pressing the update all button. It just says installing and no update is being done., my apps are not being updated when pressing the update all button. It just says installing and no update is being done.

    Must be serious because you have stated the problem 4 times now.
    Here are a number of things that you can try and maybe one of them will help.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    Make sure that you do not have a stalled download in iTunes - a song or podcast .... if you have a download in there that did not finish, complete that one first. Only one thing can download at a time on the iPad so that could be what is causing the problem.
    If that doesn't work - sign out of your account, restart the iPad and then sign in again.
    Settings>iTunes & App Store>Apple ID. Tap your ID and sign out. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Go back to Settings>iTunes & App Store>Sign in and then try to update again. Tap one waiting icon only if necessary to start the download stream.
    You can also try deleting the waiting icons - tap and hold down on an icon until it wiggles - the tap the X on the icon to delete it. Then try to download again.
    You can try resetting all settings. Settings>General>Reset>Reset All Settings. You will have to enter all of your app preferences and device settings again.
    You can also try going to the App Store, find an app that needs an update, tap on the app icon to bring up the description page, then tap on install that way, rather than using the Update option from the app updates screen.
    And ... You can always install the updates in iTunes on your computer and then sync them to the iPad.

  • HT4061 ????  How do I power up my iPad?  My iPad won't power up. It just stays a black screen.  Tried the start up button, the home button, pressing them down and holding.

    ????  How do I power up my iPad?  My iPad won't power up. It just stays a black screen.  Tried the start up button, the home button, pressing them down and holding.

    Could be the battery is completely drained. Use the charger that came with the iPad and plug that into a known good wall outlet. Let it charge for at least an hour. Then, while it is still plugged in reset your device. Press and hold the Home and Sleep buttons simultaneously until the Apple logo appears. Let go of the buttons and let the device restart.
    If the device restarts let it remain on the charger until the battery indicates 100%. If it still will not turn on Make an appointment at an Apple Store to have your device examined by a technician. Or contact Apple Support.

  • Ticker bean and WHEN-BUTTON-PRESSED trigger

    Hi,
    In Forms 6i, I use the Ticker bean. The problem with it, is that it appears on all canevas of my form.
    But if the bean is "stopped" (i.e. the clock is stopped), it works fine and it does not appear on the next canevas I show.
    However, I must have a button for the "stop" and another one that shows my next canevas. If I put the two code lines in the same WHEN-BUTTON-PRESSED trigger of a unique button, the ticker bean is still visible in the new canevas.
    Any help is appreciated.
    Regards,
    Olivier.

    Olivier,
    I think I remember having heard of this before. The reason for this could be that the ticker bean uses AWT classes, which are heavyweight. All you can try is to call
    synchronize;
    between starting and stopping the ticker if using one button only. If this doesn't help, then I don't know of any other solution that could work.
    Frank

  • Whenevenr I call a person sometimes the phone gives me an option of callback and end when I press the callback button the whole screen goes blank and only the upper Taskbar where it shows network provider , time and battery percentage is shown

    whenevenr I call a person sometimes the phone gives me an option of callback and end when I press the callback button the whole screen goes blank and only the upper Taskbar where it shows network provider , time and battery percentage is shown

    Standard troubleshooting...
    Try a reset by pressing the home and sleep buttons until you see the Apple logo, ignoring the slider if, it comes up. Takes about 5-15 secs of button holding and you won't lose any data or settings.
    Remove all apps from Recently Used list...
    - From any Home Screen, double tap the home button to bring up the Recents List
    - Tap and hold any icon in this list until they wiggle
    - Press the red (-) to delete all apps from this list.
    - Press the home button twice when done.
    If still a problem restore with your backup.
    If still a problem restore as new, i.e. without your backup. See how it runs with nothing synced to it.
    If still a problem, it's likely a hardware issue.

Maybe you are looking for

  • How can I find a corrupt file in iTunes?

    When I plugged my iPod into my PC to update it.. iTunes started to boot up giving the message that they're is a corrupt file somewhere? Now iPod screen is frozen on Do Not Disconnect.

  • Choppy video playback on my 1st Gen iMac G5

    Everything from internet video to DVD playback on my 1st Gen iMac G5 is choppy and getting more so as time goes on. Can anyone tell me if this is a symptom of the defect that's covered under the extension plan or is this just some other problem?

  • Text looks horrible and blocky when imported into DVD SP

    Why is it that all my text looks terrible when I import it from Photoshop into DVD Studio Pro for a still menu? The font size is 20pt, and the text type is Franklin Gothic, a sans serif Helvetica variation that is extremely simple and basic. Why does

  • Activating the Timeline when there are no sequences

    I have read everything I can but am stumped. I am familiar with RE 8 but used someone elses computer last week to capture a number of .AVI videos off of betacam tapes. I am trying the trail version of PR pro ver 5.5. I can import my .avi files to the

  • Can I still download the free trial of photoshop cs5?

    I have a computer with Windows Vista Business and I would like to install the free trial of photoshop CC but that doesn't work because it's Vista. Is photoshop cs5 or 6 still available because that does work on Vista.