JFrame - add mouseover capability to button

Hi, simple one here I think.
Environment:
using JAVA 1.5.0_06, Metal L&F on XP laptop
javax.swing.plaf.basic.BasicMenuBarUI
My JMenu is working just fine. I wish to have the JMenu button/image highlight during a mouseover. If I use a Windows L&F I can get it but that introduces some other problems.
Is there an easy way to add code to my app to add this feature?
thanks
[email protected]
Message was edited by:
broue

Hi,
I did this a while ago
http://www.oracle.com/technology/products/jdev/howtos/10g/jclientlov/customadfjclientlovpanel.html
Frank

Similar Messages

  • How to add search capability to LOV...?

    hello...
    is it possible to add searche capability to LOV button;
    the list that it shows is too long and it is not evident to find the wanted row?
    iam using ADF swing
    thanks

    Hi,
    I did this a while ago
    http://www.oracle.com/technology/products/jdev/howtos/10g/jclientlov/customadfjclientlovpanel.html
    Frank

  • Resizing of JFrame while the font on buttons increases

    Hey,
    I would like to ask you how to resize my JFrame ,when the size of buttons put in this frame increases.
    I mean the font on the buttons increases by 1 point every time I press the button. My goal is to make the two buttons visible all the time. Therefore I need to resize my JFrame. I tried in the following method, but it did not work :(
    (cp is contentPane() of my JFrame - frame)
    public void actionPerformed(ActionEvent e) {
    Component c = (Component) e.getSource();
    Integer nazwa= c.getFont().getSize()+1;
    int width = (int) cp.getPreferredSize().getWidth();
    if(cp.getPreferredSize().getWidth()>cp.getWidth()) {
    cp.setSize(new Dimension(width, cp.getHeight()));
    cp.validate();
    int height = (int) cp.getPreferredSize().getHeight();
    if(cp.getPreferredSize().getHeight()>cp.getHeight()) {
    cp.setSize(new Dimension(cp.getWidth(),height));
    cp.validate();
    c.setFont( new Font(c.getName(), c.getFont().getStyle(), nazwa));
    frame.validate();
    }

    pack() does not help, as I have already used it.
    Pls find below the whole code of the program:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class GUI implements ActionListener{
    final int BNUM = 2;
    static JFrame frame = new JFrame()
    static Container cp = frame.getContentPane();
    GUI() {
    cp.setLayout(new BoxLayout(cp, BoxLayout.X_AXIS));     
    for (int i = 1; i <= BNUM; i++) {
    JButton b = new JButton("Przycisk " + i);
    b.addActionListener(this);
    cp.add(b);
    frame.pack();
    frame.show();
    public void actionPerformed(ActionEvent e) {
    Component c = (Component) e.getSource();
    Integer nazwa= c.getFont().getSize()+1;
    int width = (int) Integer.parseInt(cp.getPreferredSize().getWidth().toString());
    if(cp.getPreferredSize().getWidth()>cp.getWidth())
    cp.setSize(new Dimension(width, cp.getHeight()));
    if(cp.getPreferredSize().getHeight()>cp.getHeight()) {
    cp.setSize(new Dimension(cp.getWidth(),cp.getPreferredSize().getHeight()));
    cp.validate();
    c.setFont( new Font(c.getName(), c.getFont().getStyle(), nazwa));
    public static void main(String[] a) {
    //cp.setPreferredSize(new Dimension(200,200));
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    new GUI(); }
    }

  • How to add a google+ share button to a composition?

    I am working on a little app for which I want to add share buttons.
    I don't have problems adding Facebook share and Twitter buttons, However I cannot find a way to add a Google+ share button.
    For FB I create a rectangle and name it fbBtn. Then on click I add the foolowing code:
    FB.ui({
              method: 'feed',
              name: 'Win designer fashion jewelry from Baloka',
              link: ' http://www.mysite.com/',
              picture: 'http://www.mysite.com/external-xfbml/share-image.gif',
              caption: 'Win designer fashion jewelry from Baloka',
              description: 'Baloka is giving away 22 designer fashion jewelry by Maria Mizrahi. Check this out. Do you want to win? You could...',
              message: ''
    For Twitter I create a rectangle and name it twitterBTN. Then I add this code to document.compositionReady:
    var twitter = sym.$("twitterBTN");
    var c = '<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://baloka.com/content/socialApp/fb.html" data-text="Win cool trendy designer fashion jewelry - check this out" data-via="BalokaDesign" data-count="none" data-hashtags="BalokaSweepstakes">Tweet</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id =id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(docu ment,"script","twitter-wjs");</script>';
    twitter.html(c);
    For Google + I found two ways to add a share button:
    First:
    Adding this snipped to the html document (not in EA):
    div class="edgeLoad-EDGE-467457915"><a href="https://plus.google.com/share?url={http:baloka.com}" onclick="javascript:window.open(this.href,
      '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><img
      src="https://www.gstatic.com/images/icons/gplus-16.png" alt="Share on Google+"/></a></div>
    and adding this to the head:
    <!-- Add the following three tags inside head. -->
        <meta itemprop="name" content="Baloka Sweepstakes">
        <meta itemprop="description" content="Win designer fashion jewelry by Maria Mizrahi - Baloka.
        There are 22 prizes including earrings, bracelets, necklaces and a couple of $100 gift certificates.
        Please share with your friends.">
        <meta itemprop="image" content="http://cdn2.bigcommerce.com/server2100/a154e/products/102/images/243/LittleTotemEarrings__ 55527.1355162788.1280.1280.jpg">
    This works as expected, but I am having a hard time position the button in the right place on my page. I can see the button in EA, but the position I set it in there is not maintained once the file is published.
    Thus, I would like to know how to include the code directly in EA as I am doing with the Twitter and facebook buttons.
    Second:
    Adding this to the html document (not in EA):
    <div id="gplus1" data-action="share" data-annotation="bubble" class="edgeLoad-EDGE-467457915"></div>
    <!-- Place this tag after the last share tag. -->
    <script type="text/javascript">
          (function() {
                    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
                    po.src = 'https://apis.google.com/js/plusone.js';
                    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
      </script>
    Again, this works, although with this code I don't know  how to customize the name, description and image for the info I am sharing.
    In this case I was able to include the code on EA adding the following to document.compositionReady:
    var googleplus = sym.$('googleplus');
    var click = "javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');";
    var g = '<a href="https://plus.google.com/share?url={http://baloka.com/content/socialApp/fb.html}" onclick="click";return false;"><img src="https://www.gstatic.com/images/icons/gplus-16.png" alt="Share on Google+"/></a>';
    googleplus.html(g);
    The problem here is that instead of opening a window, it replaces the page with the one supposed to be on a different window, which I don't like.
    So, in short, I need some help figuring out how to include the code directly in EA for the first method for Google+.

    I don't have an answer for you, but I do have a question. You said the FB code works. What did you do? What did you put in your html page? I tried the FB code above and it gives me an ID error. Appreciate it if you can elaborate more. I just posted the ff in the forum "Customizing FB Share in Edge Animate"
    Thank you!

  • Why am I getting this error?  How do I add confirm message to button press?

    Using Java Studio Creator.
    I do not understand why I am getting the following page error:
    Description: An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.
    Exception Details: java.lang.IndexOutOfBoundsException
    Index: 0, Size: 0
    Possible Source of Error:
    Class Name: java.util.ArrayList
    File Name: ArrayList.java
    Method Name: RangeCheck
    Line Number: 546
    ======================================================================
    I have a page that works.
    It has a button that is created in the session bean code with the following java:
    button = (HtmlCommandButton)application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
    button.setActionListener( application.createMethodBinding("#{ScheduleEditSessionBean.mainApply}", new Class[]{ActionEvent.class} ));
    button.setId( "applyUndates" );
    button.setType( "submit" );
    button.setTitle( "Apply updates.");
    button.setValue( "Apply" );
    button.setStyle(style);
    children.add(button);
    When the button is pushed, it calls the following session bean method:
    public void mainApply(ActionEvent actionEvent)
    updateScheduleData();
    scheduleAdjustFlag = 1;
    dataApplied = true;
    dataSaved = false;
    addControls();
    This all works just fine - no errors
    ====================================================================
    I wanted to add confirmation to the button press, so I removed the action listener for this button and added
    a javascript function call for the onclick method
    button = (HtmlCommandButton)application.createComponent(HtmlCommandButton.COMPONENT_TYPE);
    style = "text-align: center; font-family: 'Arial','Helvetica',sans-serif; " + font + " height: 22px; width: 115px";
    // Commented out this line button.setActionListener( application.createMethodBinding("#{ScheduleEditSessionBean.mainApply}", new Class[]{ActionEvent.class} ));
    button.setOnclick("confirmApply()"); // Added this line.
    button.setId( "applyUndates" );
    button.setType( "submit" );
    button.setTitle( "Apply updates.");
    button.setValue( "Apply" );
    button.setStyle(style);
    children.add(button);
    I added a dummy button to the page that has the following call to execute the mainApply method in the sessioon bean.
    The button action just calls the mainApply() method in the session bean
    public String mainApplyBtn_action() {
    seb.mainApply();
    return null;
    Added the javascript to the page that simply pushes the dummy button if confirmed.
    function confirmApply()
    if( confirm( 'Are you sure you want to Apply these changes?' ) )
    form1["form1:mainApplyBtn"].click();
    The session bean method looks like this it is the same method as before, but without the action event argument.
    public void mainApply()
    lsb.logMsg( "<ScheduleEditBean.mainApply> Main apply pushed" );
    updateScheduleData();
    scheduleAdjustFlag = 1;
    dataApplied = true;
    dataSaved = false;
    addControls();
    ==================================================================================
    Now, when I push the original 'Apply' button, I get the confirmation box just like I expected.
    But when I confirm the question, I get the error at the top of this post.
    If I push the 'dummy button' directly, I do not get the error.
    I do not understand why I should be gettng this error.
    Can anyone give me a clue as to why this change would cause the problem?
    The error is related to an ArrayList.
    I use several of these on the page, but they should be filled with data in the preRender method of the page.
    Can anyone suggest a way that I can add confirmation to a button that is created under program control?
    Thanks

    Make use of the fact that when an onclick event of a button returns 'false', the action will not be taken.
    Pseudocode:<h:commandButton value="submit" action="#{myBean.action}" onclick="return confirm('Are you sure?');" />

  • How do I add a close window button/image

    All I want to do: Add a close window button (round/square with an "x" through it) to either one or many html files. I don't see how to do this.
    Using RoboHelp 8 HTML and WinXP. Thanks.

    Ahh I see now. You are asking where to obtain such an image!
    The RoboHelp Gallery doesn't contain one. Sorry. You will need to obtain one from any number of other locations.
    You might look at the following link for one possibility.
    Icon Archive
    Here are a couple from my own colloection. You might right-click and save as.
    There are also a number of packages you may purchase or find. Perhaps the following link will help.
    Click here to search Google
    I cannot advise on the legal implications of using said images.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 moments from now - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcererStone Blog
    RoboHelp eBooks

  • OK since midday today firefox 3.6.24 apparently no longer executes javascript on ebay. Can't use the "add to watch list" buttons or the enlarge photo buttons. It says 'javascript at the bottom of the firefox window but nothing happens.

    just as I wrote above.. ebay loads and functions. I can bid and view auctions but trying to either use the "add to watch list" or "add to wish list" buttons or to switch between different posted photos of an item just gives me javascript:; at the bottom left of my screen but clicking the button has no effect.I'm still running 10.4.11 with the last java download.. is this an ebay change to a newer java version not supported by my os or is it a firefox error..oh and one more thing each page seems to have become 4 times longer..ie there is a huge empty space as I scroll down the page before I hit the bottom.Only appears to do this on ebay..haven't found any other sites showing similar errors and everything works fine on my imac running firefox 4 under 10.5

    Craig Stenton: at 12:13:04
    but I can't install windows! During the install I am asked for the product key and it tells me that it is not valid and so I can't proceed.
    Craig Stenton: at 12:14:16
    I can't use the usual methods of activation because I cannot get an activation code. I can't use the activation wizard. I can't call the number because it requires an activation code.
    Hi,
    I'm a bit confused with this paragraph, as you said Vista already install on your computer, why did you say Windows can't be installed?
    According to your description with your problem, it is Product edition and key are not match. Firstly of all, we must make sure the system you installed on your computer was
    Windows Vista Business, not matter 32 or 64 bit.
    Note: you can check current system edtion at System Properties.
    After that, you can try to input your product key and activate your system for test.
    If problem still presists, it would be better to provide the activation error message.
    Roger Lu
    TechNet Community Support

  • How do I add a functional "submit button" to a pdf form in Adobe Acrobat Pro XI ? I created the pdf form in Adobe Forms Central.

    How do I add a functional "submit button" to a pdf form in Adobe Acrobat Pro XI ? I created the pdf form in Adobe Forms Central. It's for an online Diet Questionnaire. After people complete the form I'd like them to click "SUBMIT" and the completed form will be emailed to me.

    This can be a bit confusing because Acrobat 11 comes with the desktop app that allows you to create simple PDF forms without having a FormsCentral account. Some people find this helpful, but you need to understand that when you generate the PDF form, it is Reader-enabled by Acrobat. In order to edit the form further in Acrobat, you have to create a non-enabled copy of the form. You do this in Acrobat by opening the form and selecting: File > Save a Copy
    and opening the copy. It is not opened automatically.
    You can now add a button and set it up to submit by email, either using a "Submit a form" action or the submitForm JavaScript method. You can set it up to include just the form data or the entire PDF, and will want to use a mailto type URL. Submitting the form to the FormsCentral server has a number of important advantages over email (much more reliable, more secure, etc.), so you might want to consider it.
    If the form needs to be saved with Reader versions prior to 11, then you will need to Reader-enable the document. In Acrobat 11 you do this by selecting: File > Save As Other > Reader Extended PDF > Enable More Tools

  • How do I add a submit form button to my form?

    I am creating a form in FormsCentral.  How do I add an email submit button, as an object, to the form?

    Hi,
    Please refer to the following forum thread:
    http://forums.adobe.com/message/5797460
    Regards,
    Brian

  • How do i add a facebook share button to my webpage

    how do i add a facebook share button to my webpage

    I use a Facebook logo and then encourage people to like the page. But I do have a couple of clients who have asked me to do this.
    Here's the link on Facebook's site for share buttons:
    https://developers.facebook.com/docs/plugins/share-button/

  • Can the "ADD-A-NEW-TAB" button be reconfigured to be adjacent to existing tabs (like it used to be)? I am a left-handed tablet user who finds it's position on the far right side of screen very inconvenient.

    In previous version of Firefox, the "add-a-new-tab" button has been located to the right of any existing tabs. In the latest version it's been moved to the far right of the screen. In tablet mode, this is too far to reach conveniently for a left-hander. I cannot find any controls to re-configure it to the way it used to be and I can't "drag" it to where I want it. Is there a way to relocate it?

    Thanks. I don't know why it wouldn't just go back there when I tried putting it back? I didn't change anything, so I assumed the new "default" was over on the left. Glad it was a simple solution after all.

  • How do i add a Full Screen Button?

    Hi guys,
    I have used Quicklime X - File > Save for Web option to upload a video to my web site.
    This gave me a Java Script player and code to embed into my site, i have all the files running local on my server and the videos works well.
    My problem is that there is no full screen button on this player...
    Dose anyone know where i could find some code to add a full screen button to this player?
    I cant imagine it being to hard... but my knowledge of java is very limited.
    Thanks for your help
    Alex
    Edited by: swishk on May 21, 2010 10:35 PM

    Despite the similarity in names, Java and JavaScript are separate languages. For embedding Flash players or controls in web pages, you would be using JavaScript.

  • How do I add a full-screen button to mp4 videos?

    I am making a multi-screen HTML 5 help project.  We want to add videos.  Right now the videos are mp4, but really we could convert them to anything.  I want the videos to appear on the page at a nice small specified size.  That I can do.  However, I want the user to be able to expand the video to a boarderless full-screen size, similar to Youtube videos.  I can't find any option to add a full-screen button to the video player.  Can it be done in Robohelp?  Do I have to buy an external video player?
    Thanks.

    Despite the similarity in names, Java and JavaScript are separate languages. For embedding Flash players or controls in web pages, you would be using JavaScript.

  • How can i add a donate now button to my iweb website

    how can i add a donate now button to my iweb website

    Here's some info about PayPal buttons....
    http://www.iwebformusicians.com/Internet-Music-Sell-Distribute/PayPal.html
    A "Donate" button is created in the same way as a "Buy" button.

  • How to add custom link or button to task details page to open a different t

    Dear All
    In HumanTasks Workflow, On task details page, I want to add a custom link or button. Clicking on this link or button, should load a different task details page.
    The exact business usecase is like this:
    1. We have some human tasks with very detailed payload like about 100 attributes. When the task is submitted for Approval, we send notification emails. These emails shows the Task Details with all these 100 attributes along with standard Approve, Reject buttons etc. NOW in addition to this, we want to add extra custom button/link like Custom View. When we click on this buton or link, it should replace the task details page with the Custom task details page contents. The reason is most of the managers/approvers access their emails on smart phones like iphones. So in these phones, seeing full task details (100 attributes) is very tedious. So we want to provide a simplified view of same task with very minimum attributes like about 10 with Approve, Reject buttons. Now this compact view details will have a button called Detailed View on click on which it loads details page.
    So we want to have 2 pages for a task:
    taskDetails1.jspx -> Has all 100 attributes with a custom button/link called "Compact View". Click on Compact View switch to below page.
    taskCompact1.jspx -> Has only 10 attributes with a custom button/link called "Detailed View". Click on Detailed View switch to above page.
    1. I tried implementing this using the VacationRequest sample where the payload is like creator, startdate, enddate, reason. I already have taskDetails1.jspx page, which shows this information in the email body.
    2. I want to add another button to taskDetails1.jspx so that when I click on it, I want to load a different page like taskCompact.jspx which has only say creator, reason.
    I already added a link and gave the url with parameters like taskId, taskContext etc which I got from bindings, but nothing is displayed when I click on custom button. The taskId, context values are comming correctly in the url.
    So bottom line, what is the URL that I can provide in the task details page, to load a different task details page contents. I want to pass other taskdetails jsp details.
    Please let me know, if there is any other approach to implement this usecase.
    Thanks in advance
    Ravi Jegga

    Hi,
       I am not sure if you can add your own custom buttons to the application tool bar because your table control is in a sub screen area in a standard screen so the menu area would be controlled by the standard screen and not the subscreen , but along side the table control you can give buttons for scrolling and handle the same in the subscreen if you check the FM EXIT_SAPLMEREQ_002 it has a variable IM_UCOMM which would have the ucomm set in the subscreen so here you can handle your user command to scroll on the table control.
    Regards,
    Himanshu

Maybe you are looking for