Borderless button THAT HIGHLIGHTS

I have a JButton with an image on it and some text. I don't want this button to have a border painted...but I DO want it to highlight when it's pressed. I see the thread [http://forums.sun.com/thread.jspa?messageID=2746046] but this doesn't make the button highlight when pressed. Is this possible?

A compilable example of changing foreground color:
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import javax.swing.ButtonModel;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
class FuSwing1
  private JPanel mainPanel = new JPanel();
  private JButton button = new JButton("Fubar");
  public FuSwing1()
    button.setBorder(null);
    button.setPreferredSize(new Dimension(120, 50));
    int btnSize = 32;
    button.setFont(new Font(Font.DIALOG, Font.BOLD, btnSize ));
    button.addChangeListener(new ChangeListener()
      public void stateChanged(ChangeEvent e)
        ButtonModel model = button.getModel();
        if (model.isPressed())
          button.setForeground(Color.red);
        else
          button.setForeground(Color.black);
    mainPanel.add(button);
  public JPanel getMainPanel()
    return mainPanel;
  private static void createAndShowUI()
    JFrame frame = new JFrame("FuSwing1");
    frame.getContentPane().add(new FuSwing1().getMainPanel());
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
  public static void main(String[] args)
    java.awt.EventQueue.invokeLater(new Runnable()
      public void run()
        createAndShowUI();
}

Similar Messages

  • Creating a button that highlights itself and another object

    Hello all,
    I have a specific function I am trying to apply to my InDesign document intended for exporting to an interactive PDF and SWF/html format.
    The function I am trying to create is:
    I have a picture of a typical WYSIWYG tool bar. I have created highlight buttons that sit on top of each icon in the picture. When the reader rolls over (with cursor) this picture of an icon I want it to highlight, and also a piece of text further down the page to highlight as well (which is a definition and explanation of the icon). So I want the rollover action of my first button to also trigger another action, which is to highlight a piece of text elsewhere on the page. I have managed to get it so that I hover over the first button (picture of icon), it highlights, and the text further down the page appears. But this isn’t quite what i want. I want the text to exist already, then highlight. Basically, I want to the two buttons to be linked. So that every time I hover over a portion of the picture with a created button, it will highlight, and a piece of exploratory text will also highlight simultaneously elsewhere on the page. A bit like an infograph. Surely this is possible?
    Thanks in advance for your help.

    Generally, animations like this with the goal of exporting a SWF are better be done in Adobe Flash.
    In Indesign it sort of works, too. Only for export to SWF, you can assign the action "Go to status". For a text frame, you can assign different status, where the 1st status would be "normal" and the 2nd status would be "highlighted". Highlighted applies to the object "text frame", so you can assign a stroke or fill. Better than nothing.
    Example: Dropbox - test_highlight.indd

  • How to make a navigation bar with buttons that stay highlighted

    I have Dreamweaver MX 2004. I know how to make a simple nav
    bar, but how do you make it so it's like the Apple website, with
    buttons that stay highlighted on the appropriate page?

    "[email protected]" <[email protected]>
    wrote in message
    news:gd04sb$5mc$[email protected]..
    >I have Dreamweaver MX 2004. I know how to make a simple
    nav bar, but how
    >do you make it so it's like the Apple website, with
    buttons that stay
    >highlighted on the appropriate page?
    http://divahtml.com/products/divaGPS/current_menu_location.php
    Thierry
    http://www.TJKDesign.com/go/?0
    | Articles and Tutorials
    http://divahtml.com/products/scripts_dreamweaver_extensions.php
    | Extensions
    that keep your markup clean
    http://www.fourlevel.com/ |
    CSS Menus, Gallery, Tab Panels, etc

  • How to create text buttons that link to video?

    I've finally gotten around to trying DVD SP, and even though I read the whole manual, it's not at all clear if, or how, you can create text buttons that link to the video you want to play, without displaying a clip of that video in the button itself.
    I have no problem creating a text button, but I can't change the font, and editing is counter-intuitive, unlike iDVD. I'd use iDVD, but it doesn't accept .m2v files, and it seems to think that my 6 videos of about 43 minutes each are too large for a DVD+DL disc, so it won't let me burn it or save it as a disc image.
    Does anyone have a way out of this conundrum, or am I SOL?
    Mulder

    It really isn't that hard!
    As Drew said, go into your menu and click and drag to create a button rectangle. With the button highlighted, look in the property inspector at the bottom and type in the text that you want to use. Ensure that you 'include in button highlight' and then set the colour choice for selected and activated.
    What you get is a simple line of text which illuminates when you roll over it, and changes colour when you click on it.
    Once that is done, click on the button area again and set the target to go to the piece of video that you want to have play back.
    You should also set the menu call and end jump on that track to make sure your viewer can get back to the menu.
    Once that is done the menu will show as a simple piece of text (more buttons means more bits of text, and the first button will be highlighted by default) and no video will play until the button is activated.
    DVDSP is definitely a steeper learning curve than iDVD but for very good reasons. You get far greater control and access to far more advanced features in DVDSP. This means that some things will seem harder, whereas in fact they are just different and the process for achieving the result you want is different. Much of what you want to know is in the manual and also in the tutorials which came with the app. Failing that there are several good online spaces where you can find a lot more information... not least of which is right here, of course!

  • I am trying to set up my newly purchased Apple TV but when I enter my network password while setting up, I am not able to enter the Submit button, any idea how to hit the visible submit button that is visible on screen but not responding?

    I am trying to set up my newly purchased Apple TV but when I enter my network password while setting up, I am not able to enter the Submit button, any idea how to hit the visible submit button that is visible on screen but not responding?

    You need to use the right arrow on the remote to go all the way to the right. The submit button will be highlighted and you can then press select on the remote to proceed.

  • How do you make a custom button that is Invisible When not selected

    Im just recently switching over to using a mac for authoring. I really like all the features in DVD Studio more than what i was using on a PC for the past 6 years. Which was ulead DVD Workshop 2.
    The only problem im having (For Now) is that i cant make my custom buttons invisible. I made this little black shape thing in photoshop and i want to use it in DVDSP for selecting different tracks.
    I thought all i had to do was just save the black shape with a transparent background in photoshop as a .psd and import it. But that didnt work.
    When i change episodes it just stays black the whole time. I want something that will be invisible when it is not selected.
    please help
    I can send someone my little shape if they can make it a usable button that i can make invisible in dvdsp. I really need to see the layers done with a shape as a button to see how they were able to make it invisible.
    i tried a few tutorials but instead of being invisible all i got was a shape that was stuck white the whole time. this is even when i put the opacity to 0 on normal.
    I want to make this into a button
    http://img694.imageshack.us/i/custonbutton.png/

    Ok, what you want to do is also in the same tutorial. See the section on "Advanced Highlights" (again, avoid the sections on layered menus), You can create an overlay that does have two colors. The bad news is that there will be absolutely no anti-aliasing at all. This means your graphic will be extremely pixelated. This is just the way the DVD specs are set up, so there is no way around it.
    Given that I would highly recommend redesigning your overlay. Take a look at variety of DVDs from Hollywood. See what they are doing in their menus. You can do anything they are doing, but you will notice that the overlay is very simple because of the limited anti-aliasing of DVDs. In all the years that I've been watching DVDs I've only see one DVD use two colors in the overlay, and that was the Jim Carey "The Grinch who Stole Christmas."

  • Radio Button Widget Highlight Options

    In Captivate 5.5, is it possible for the standard radio button widget (RadioButtons.swf) to not have a highlight color behind the text? I just want a transparent background with text so the master slide background shows. Adjusting the Alpha Channel only effects the radio buttons themselves, not the highlight color.

    Hello and welcome to the forum,
    But I have bad news, having explored this widget a lot, and struggled with that 'highlight color' a lot. I try to put it on a uniform colored background and apply the background color as a Highlight. Didn't find another way.
    Perhaps a tip: do download the enhanced version of this widget, that allows you to control it more (variable can be changed by advanced actions and displayed). It was created by Jim Leichliter (CaptivatePro) and it is FREE:
    Radiobuttons Enhanced
    Lilybiri

  • Creating a button that will Copy my view from so I can paste it to MS Word

    Is there a way I can create a button that will copy my view from so I can paste it MS Word?
    I know I can select the entire form and copy and paste it, but is there a way to do it via a button similar to my "Print Form" button?
    Thank you.

    so there isn't a button that will copy the text my view form?
    instead of highlighting the data I want to easily copy it so I can paste it on a word document
    I came up with a script that when a item is highlighted I click the copy to clipboard and it copies the item.
    <script type="text/javascript">
    function CopyToClipboard()
    CopiedTxt = document.selection.createRange();
    CopiedTxt.execCommand("Copy");
    </script>
    but is there a way I can put in the script the area I want to start the copy from instead of highlighting the text first?
     

  • Hidding Button Text & Highlight Thumbnail

    I'm fairly new to DVDSP. I would like to create buttons that do not show the text and have the border highlighted when you mouse over (or use a DVD remote arrow buttons).
    I would like to create a chapter index template that I can use build a chapter index. The problem is my chapter names are really long and there is no reasonable way to show them. Thus, I want to eliminate the chapter name text from the buttons.
    The only way I have found to "get it done" seems to create the chapter index, then manually remove the button text for each button. To get the remaining button to highlight, I seem to have to choose a shape like "Picture Frame Rectangle White".
    I could deal with deleting the text, but I don't like any of the border highlight shapes that I have found as the ones that seem to both highlight AND show the still or motion are not what I'm looking for. Something like "L Shape Highlight" could work, if only it was programed to show still/motion.
    Any suggestions would be appreciated.

    When you create a chapter index by dragging a track with markers onto a button on a template, hold it and select "Create Chapter Index" from the pop-menu then select a index template. If you use any of the Apple supplied templates, such as "Brush Index", it creates the appropriate index pages. Each index page has buttons to access the specific chapters. All the buttons on these index pages seem to include the chapter name (as set in the chapter marker) and most include a preview of the video starting at that chapter index.
    The chapter names I assigned are the names of the people in the video clip. When there are 2 or more names, it is too long to fit in the space allotted for the chapter title in the chapter index. It does not make sense in this context to name the chapters something short that could be displayed on the chapter index. Instead, I would like to tell DVD studio NOT to display the chapter names on the chapter index, thus only displaying the button with the video preview.
    The only way I found to prevent the text from showing is create the chapter index, then, delete all the text in each button, leaving only the preview.
    The problem with this approach is most of the button styles change the TEXT highlighting when the button is selected. When there is no text, you can not tell which button is selected.
    As a result not only do I want to turn off the text for the buttons, I also want to be able to have the a highlight show on the non-text portion of the button.
    Let me try to provide a visual for this: you look at the Apple Template "Brush Index". Remove the text from each button. Next, instead of having the text change color in the "Selected" and "Activated" show a colored border around the video preview when Selected or Activated. That's what I'm trying to do.
    I have not found a good way to accomplish this seemingly simple task in DVDSP using the Apple provided buttons and templates. Hopefully I'm missing something and there is an easy way to do this.
    NOTE - this is a trivial task in other programs (i.e. Nero Vision for Windows). The reason need to use DVDSP is this is the only application I have that supports multiple video angles.

  • Is there a way to create a button that links to a website?

    Is there a way to create a button that links to a website?
    I was reading up that it's possible to this with menus, and tracks but can you do it with a button and how?
    I am hoping to create a button that people viewing my discs on a computer can click on the link and their web browser will pop up and take them to a website.
    Any help is appreciated.
    Thanks.
    -Fraky

    dvd@ccess questions are being asked once a week on this forum, so I'll repeat why it's useless:
    - Mac users have to enable the feature in the preferences of DVD Player in order to for the links to work.
    - PC users have to install a small application on their PC, and they have to reboot the PC in order for the links to work.
    - On top of this, it's still unreliable, and may not work on some computers.
    It's a dog: Don't use it.

  • How to create a button that Copies subform data and paste it to a new page?

    Hi , I'm want to create a button that when clicked copys all the data from the feilds of a subform off the previous page and paste it into current page.
    I have used Steve's "Simple table.pdf example" to add a subform called DecorationDetail that has a button that adds an instance when clicked.
    Contained in the decorationdetail subform are feilds named Quantity, Description,UnitPrice etc. and a delete instance button.
    So when the first page is filled out, and a second page with blank duplicate feilds is added by a add page button. I want to be able to click a button
    positioned at the end of the row of feilds, and it then copies the same subform data from the previous coresponding page and pastes it into the current page subform feilds.
    Hope this make sense?. A step by step guide would be greatly appreciated!!!.

    Hi,
    Does this article provide you with some clues? http://www.perfectwebtutorials.com/2011/how-to-create-simple-contact-form-in-flash/
    Thanks,
    Preran

  • Mid 2011 Macbook Air - Yosemite keyboard and trackpad stopped working, the only button that worked was the power button, only one USB port works.

    I have a Mid 2011 Macbook Air.
    Upgraded to Yosemite last week.
    Three days ago I was using my Macbook Air for the first time since upgrading to Yosemite. I had been using my Macbook Air for approximately 30 minutes, I was using safari and the keyboard and trackpad stopped working (would not respond). The only button that worked was the power button.
    I rebooted and they were still not working. I plugged in a USB mouse and external USB keyboard, only one USB port would work (the Left USB port if looking at the screen) so I had to swap between keyboard and mouse.
    After logging in there is a bluetooth icon at the top of the screen with a sawtooth line through it. Bluetooth is unavailable and the bluetooth icon is missing from the system preferences menu.
    If I run a hardware test by holding D (on USB keyboard) at startup it says that no problems are found and at the conclusion of the test the keyboard and trackpad start working again. When I log on the bluetooth is working again.
    I shut down the Macbook Air and when I started it again the keyboard and trackpad and right side USB ports were all not working again. I logged in using the USB keyboard and mouse and the bluetooth not available sawtooth icon had returned.
    I ran the hardware test again and at the conclusion of the test the trackpad and keyboard started working again.
    I have tried deleting com.apple.Bluetooth.plist and com.apple.Bluetooth.plist.lockfile from /Library/Preferences/ and tried resetting SMC and Power Functions but this did not fix the issue. The only thing that seems to work is running a hardware test - obviously I don't want to do this every time I use the computer.
    I do not believe any hardware is faulty/damaged - I think it has something to do with bluetooth/Yosemite.
    I do not have the Macbook with me at the moment, if you have suggestions that I can try or additional checks/info you require please let me know and I can get back to you.
    Thanks,
    John

    Hi!
    I have exactly the same problem, and I can't find any solution.
    I can't even track down the root of the problem: the Bluetooth/Wifi module? The trackpad? The keyboard/top case? The logicboard?
    I've tried all the usual: SMC/PRAM reset, clean install, kext cache clearing.
    Any suggestion is greatly appreciated!

  • How do I get iTunes to recognize a new device if I accidentally did not hit new device when I first hooked it up? I hit the button that said I wanted to back it up from my old info

    How do I get iTunes to recognize a new device if I accidentally did not hit new device when I first hooked it up? I hit the button that said I wanted to back it up from my old phone. The new phone is my husbands and I don't want to back up my phone info on it. I re connected it hoping it would prompt me with the option again and it doesn't , it just shows up as a back up to my phone. How can I get it to give me that option in the beginning again

    First of all, I think the first time you sync an iPod that's formatted for Windows on a Mac, the sync process reformats it for Mac. You can check what it is now by looking for the iPod with Disk Utility. If it's Mac OS Extended, it's formatted for Mac already.
    Also, there is no current iPod updater app these days. iTunes handles it through the Restore button. If you are not able to use the latest iTunes because of your Mac, I can understand. The latest version of iTunes should run with 10.3.9 or later, if the hardware can handle it.
    You said the battery was low so let it recharge for a while.
    You should also reset the iPod. It's part of the 5Rs, which you should go through as the starting point for iPod trouble-shooting.
    http://www.apple.com/support/ipod/five_rs/wheel/

  • Ipad air 2 there's no silent mode like the other iPads ?? the button that does it does not exist on the iPad air 2 what does replace it??

    ipad air 2 there's no silent mode like the other iPads ?? the button that does it does not exist on the iPad air 2 what does replace it??

    hi the older button could be set to either "force portrait mode" or "silent mode". now you can do both in the iOS control center (swipe from the bottom of the screen), so the need for a button isn't needed anymore.

  • How to create a dropdown menu with sub buttons that link back to the labels on click.

    im trying to create a dropdown menu buttons that when you rollover to the top central button the button it opens up like a drop down menu would containg two other subsectional buttons. This makes the sub sectional buttons seperate from the main stage making it difficult to simply give them a on click,  sym.play("label") function.
    the buttons work like this in symbols or sections stage/panel/homebutton inside home button is group dev containg another group dev containg the button which I need to link back to a "label" in the /panel/ symbol or section. Thank you very much.

    pdp_1 wrote:
    Hi!
    I would like to create a DVD menu that offers two languages. So the first page gives two options: Language 1 and Language 2. Then depending on which language you choose, you go to a menu that proposes different videos and a photo slideshow.
    Regardless on which language button you click on initially, you get the same content but in different languages.
    I've been looking at Premiere's templates, which I can certainly customize, but I really don't see how to create the double menu. Does anybody have an idea?
    Put the video with the first language on the timeline followed by the video with the second language.  Use chapter markers so you can have each video as a chapter in the menu.
    I use Premiere Pro, so I can't give more specific directions. Perhaps somebody like ATR will chime in.
    Also, I have another question: can I put videos from different projects in the same DVD with Premiere or must all of the videos that go into the DVD be in the same project?
    Thank you very much!!!
    pdp1
    They must be in the same project.

Maybe you are looking for