Changing default highlight of a JButton

I would like to set the highlight of a JButton to be more obvious by setting the background to yellow when the button is highlighted. How can I do this?
Thank in advance,
epmc

//Folder:       Ch2MouseEvents
//Programmer:   Bradley/Millspaugh
//Date:         6/2001
//Class Name:   MouseEventsApplet
//Description:  This class demonstrates the MouseListener.
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class MouseEventsApplet extends Applet
           implements MouseListener, ActionListener
     //Create Controls
     TextField txtName = new TextField(35);
     Button btnCalculate = new Button(" Calculate ");
     public void init()
          //Place components on the panel
          add(txtName);
          add(btnCalculate);
          //Add Listeners for components
          txtName.addMouseListener(this);
          btnCalculate.addMouseListener(this);
          btnCalculate.addActionListener(this);
          //Set focus to txtName
          txtName.requestFocus();
     public void mouseClicked(MouseEvent e)
     { //Empty method
     public void mousePressed(MouseEvent e)
     { //Empty method
     public void mouseReleased(MouseEvent e)
     { //Empty method
     public void mouseEntered(MouseEvent e)
          //Set the button's colors to blue and cyan
          btnCalculate.setForeground(Color.blue);
          btnCalculate.setBackground(Color.cyan);
          //Show text on browser's status bar
          showStatus("Calculate");
     public void mouseExited(MouseEvent e)
          //Set the button's text color to black
          btnCalculate.setForeground(Color.black);
          btnCalculate.setBackground(Color.lightGray);
          //Show text on browser's status bar
          showStatus("Ready");
     public void actionPerformed(ActionEvent e)
          //Respond to a button click
          showStatus("Calculate button clicked");

Similar Messages

  • Captivate 5.5 - Change default highlight box settings before recording

    Hi, I'm trying to change the color of the default highlight box added to recordings. I need to change this at the global settings level and not project and before recording starts. Any suggestions?
    Thanks.

    Hello and welcome to the forum,
    Could you explain this 'at the global settings level and not project....'? What did you change? Normally you'll have to change the object style of the highlight box:
    If you do this without opening the first CP-file, the style will be applied to all your new projects while recording.
    Lilybiri

  • Change the default highlight color

    In the previous version of Acrobat, you used to be able to select a default color for highlighting. I use color-coded highlighting a lot and I can't find a way to change the default highlight color in Acrobat DC. It looks like the only choice I have is to change the highlight color of each highlight individually.  Where did the highlight color preference go?

    After changing the color of a highlight right-click it and click "Make current properties default".

  • Can't change the color of a JButton when selected

    I'm unable to change the color of a JButton with the following code:
    UIManager.put("Button.select", Color.cyan);
    SwingUtilities.updateComponentTreeUI(this);
    This works just fine with 1.2.2 but when I use 1.3.1 the JButton turns gray instead of cyan. What changed between these versions?

    Hello,
    I tested the following code and it works on JDK1.3.1:
    import java.awt.*;
    import javax.swing.*;
    public class RedButton {
    public static void main(String args[]) {
    JFrame frame = new JFrame("Red");
    frame.setDefaultCloseOperation(
    JFrame.EXIT_ON_CLOSE);
    Container c = frame.getContentPane();
    JButton defaultColor =
    new JButton("Default Colors");
    c.add(defaultColor, BorderLayout.NORTH);
    UIManager.put("Button.background",
    Color.RED);
    JButton red =
    new JButton("Red");
    c.add(red, BorderLayout.SOUTH);
    frame.setSize(200, 100);
    frame.show();
    You also can use one of the following properties, instead of background:
    Button.background
    Button.border
    Button.darkShadow
    Button.focusInputMap
    Buton.font
    Button.foreground
    Button.highlight
    Button.light
    Button.margin
    Button.shadow
    Button.textIconGap
    Button.textShiftOffset
    So, as you can see, there is no select Option.

  • Changing the highlight color of a JMenuBar

    I'm trying to change the highlight color of a JMenuBar. I�m using the METAL lookandfeel which by default highlights with a purple color. I would also like to know how its done on a JTable, I assume it is quite similar.

    UIDefaults uid = new com.sun.java.swing.plaf.windows.WindowsLookAndFeel().getDefaults();</code>
    Note that this will print the default properties for the Windows Look&Feel, not the Metal Look&Feel.                                                                                                                                                                                                                                                                                                                                                                                                                               

  • In Pages 5.0 How do I change the highlight color?

    In Pages 5.0 How do I change the highlight color?

    Oh!  I understand now.  See screenshot below.  It's called "Character Fill Color":

  • How to change  default unit on Database 11g

    Hi All
    I'm using Oracle Database 11g Enterprise Edition Release 11.1.0.6.0.
    If I define my column:
    USERID VACHAR2(8) --> Default USERID VACHAR2(8 BYTE)
    How can I change default unit BYTE to CHAR as the following
    USERID VACHAR2(8) --> Default USERID VACHAR(8 CHAR)
    Thanks alot
    Thiensu2810

    I have set Database system with the following SQL:
    alter system set nls_length_semantics=char;
    alter session set nls_length_semantics=char;
    But, It does not match.
    And when I insert data, the following error occured.
    SQL> insert into binhtest values('初期化パ');
    ORA-12899: value too large for column string (actual: 12, maximum: 8)
    I've checked value of NLS_LENGTH_SEMANTICS, it is CHAR
    SQL>SHOW PARAMETER NLS_LENGTH;
    NAME | TYPE | VALUE
    NLS_LENGTH_SEMANTICS | String

  • How to change default FCoE QoS class - Nexus 5020

    I see that on a Nexus 5020, the default FCoE QoS class is 50%. I am not using FCoE so I would like to adjust this value to 0%. I switch complains and says I can't change default values. How should I go about getting around this to eliminate the FCoE queue and give 100% BW to default? Thanks.

    No. The default classloader is a builtin classloader in
    the JRE. You can use other classloaders.
    The java.net.URLClassLoader is provided in
    the JDK. That's the only one. Otherwise you
    should subclass ClassLoader and implement
    the loadClass method (f.i.
    loadClass("my.program") {
    String file="my.program".replace('.','/') + ".class";
    // find the file in classpath
    // read the class file in a byte[]
    return defineClass(byte[]);
    although this is not the advised way to do it. Search the web for how to implement a classloader directly.

  • How to change default thresholds for some metrics of all targets.

    Hi!
    We have a lot of servers which have to work hard.
    So, our OEM very often generates messages like these:
    "EM Alert: Critical:dbsora90.tsb.kz - CPU Utilization is 99.95%, crossed warning (80) or critical (95) threshold."
    "EM Alert: Critical:dbsora94.tsb.kz - Disk Device c8t60A9800043346C384C344A4A63516D6Ad0(ssd4) is 99.7% busy."
    "EM Alert: Critical:dbsora94.tsb.kz - CPU Load (Run Queue Length averaged over 5 minutes) is 20.78, crossed warning (10) or critical (20) threshold."
    I need to change default tresholds for mentioned metrics but I can't their defenition in SYSMAN.MGMT_*-tables or suitable settings in OEM GUI.
    And I have no time to edit treshholds manually for each target. )

    Modification of Metric Thresholds (as this is what you are referring to), should be done using the Metrics and Policy Settings link (to be found in the Target Home page).
    Don't mess around with the SYSMAN tables!
    Best thing to do here is to start using Monitoring Templates for this.
    Check:
    Oracle® Enterprise Manager Concepts
    11g Release 11.1.0.1
    http://download.oracle.com/docs/cd/E11857_01/em.111/e11982/toc.htm
    Regards
    Rob
    http://oemgc.wordpress.com

  • How to change default output XMLP report  to rtf/excel !

    I used xmlp 5.6.2
    The default output for report is pdf file.
    Now i want to change default output to rtf or excel file
    Please ! help me !

    Hi Brightsea,
    We customized the code in FNDRSRUN.fmb, But we are not able to get the output in RTF format.
    Our requirement is to display the report output in .rtf or .xls(Not required to defaultly as .rtf or .xls).
    we are getting the following error.
    "The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'http://galaxian.bluestar.cvg0:8000/OA_CGI/FNDWRR.exe?t...
    {\rtf1\ansi\deff0"
    ^
    Regards,
    suresh.

  • How to Change Default User Directory without changing System Directory

    Hi Everyone,
    I need to change default User Directory for my JDeveloper 11.1.1.0.2.
    Default User Directory = C:/JDeveloper/mywork
    Default System Directory = *<JDEV_HOME>/System*
    Now I Need to Change it to
    My Default User Directory = C:/Monty/JDev11g2/
    But System's Default Dir = *<JDEV_HOME>/System*(Same)
    For this i explicitly Set variable ide.user.dir to C:/Monty/JDev11g2/ in JDev.boot file as explained in Installation document.
    Working fine but it contains System Folder too. I don't want this.
    Any Help to find me separate these both as it works for Single User.
    Thanks,
    Fizzz...

    Hi John, You must be right if i'd believe in ghost, A Ghost of System's Folder :-). Well that's true, We should ignore it. But still If someone finds any Clue then let me know.
    Thanks
    Fizzz...

  • How to change default compile directory tmp_ejb?

    Dear all,
    Someone knows how to change the default directory "tmp_ejb...." in WebLogic Server
    7.0?
    This is the default directory where WebLogic Server 7.0 generates and compiles
    the EJB's declared in config.xml.
    I try to specify the attribute TmpPath="ANOTHER_TMP_LOCATION_DIRECTORY_FOR_EJB"
    in the EJBContainer node but still doesn't work.
    The same thing happens when I test this attribute on EJBComponent declaration.
    Someone knows if there is an enviroment variable that specify this tmp_ejb location
    path?
    It's false that the tmp_ejb is located where the config.xml file is placed.
    I have 3 weblogic servers and they haven't the same behaviour.
    Someone can help me??????
    Thanks.

    I ran into the same problem and was wondering if you got an aswer the question you posted in BEA's news group: "How to change default compile directory tmp_ejb?
    Thanks

  • How to change default approval for ResourceAuthorizerApproval ?

    Hi,
    I'am new in OIM and I follow documentation where I found some predefined workflows. I'd like to use them.
    Could you tell me, step by step, how to change default approval for ResourceAuthorizerApproval (only for my new defined resource).
    I'm using OIM 11g and Design Console 11.1.1.3.0.2.0

    Ok, I made new tamplate (copy of existing one), there I changed Template Level Approval Process and set allowed resources. It seems to be ok :)
    If there are other solutions please share with me
    Thanks
    M.

  • How to change default Current Flag values for SCD2?

    I'd be curious to find out how to change default Current Flag values for SCD2 (instead of 0/1 to use N/Y)
    Probably I can change IKM module .... is there another way?
    Thanks

    Hi,
    You need change the IKM. This values are hardcode in the IKM.
    You can create a new IKM and the values used are a options of the IKM.
    Regards
    Edited by: Uthred on May 18, 2009 4:27 PM

  • How to change default save as location

    hi,
    how to change default save as location in acrobat 7.0?

    Why is Acrobat involved in this process at all? Why don't you save directly the pdf from your email program directly where you want it to be? Acrobat is just adding another step to this process.

Maybe you are looking for

  • Default option for password in UME

    Hi, Is there a way that when we create new users in UME, that the default option for password management is set to "Disabled Password" in stead of "Define Initial Password". We are using SPML SOAP message to create the users and if there is no passwo

  • Exception handling with fault message type not working

    Hi, I have a sync proxy to proxy scenario and I have created a fault MT and specified in the outbound and Inbound service interface... *In Inbound proxy I have the following code--*...... RAISE EXCEPTION TYPE z_cx_test_fault EXPORTING standard = l_st

  • Leave a disc in?

    Is there any problem with leaving a disc in my iMac's drive on a regular basis? I don't use the disc drive very often but my son plays a certain game that is on DVD and I thought--why not just leave it in the drive instead of putting it away every da

  • Internet connection settings

    Hi, I recently went on holiday to China for a week and during that period I used airport wifi connections and the broadband connection in my hotel room, but since my return home my dial up connection has been giving me problems. When I go into System

  • Bought season pass now how do i download new episodes

    i bought ha season pass for suits season 2 and downloaded the 4 available episodes. now there's a fifth episode and i clicked on the itunes store on my computer and nothing happens. on the left side is the explanation of season pass that says "future