HELP: creating an Icon-only Button

Hello!
I've got the following problem: I would like to create a Button that has the appearance of a 23x20 pixel icon that I've stored on the hard disk, i.e. no regular button body around the icon. I've reached some progress myself by extending the new class, OwnButton, from JButton and overriding the protected void paintComponent(Graphics g) method, but it doesn't really give the results I wish. The icon does paint itself correctly without anything else around it, but the area of the JFrame in which the button is placed is larger than the icon itself but is transparent. In other words, the button is bigger than the icon, and the icon is painted in the top left corner of the button, with the rest of the button being transparent. I've tried using the setMinimumSize, setPreferredSize, setMaximumSize and setSize methods of the OwnButton without success.
If anyone has any ideas about how to solve this problem, please share them with me. I'm very grateful for any hints.
Thank you,
MS

You don't need to subclass JButton. You can achieve what you want with the methods
setBorderPainted(false);
setIcon(myIcon);
setText(null);

Similar Messages

  • Creating simple text only buttons?

    My first post. And my first DSP project.
    This project is a series of video clips that have chapter markings.
    I've read up on how to do custom backgrounds, and I'm okay so far.
    The challenge is to create up to very simple 14 buttons for the chapters, in a way that I can easily copy and rename them for the next menu and the next dvd in the series.
    I'm looking to create the simplest buttons, in fact, white text only would be fine. I'd want the 3 states to work.
    The button templates in DSP3 allow me to create buttons, but the ones I've tried all seem to be appear with a "button" image also, rather than text only.
    Any suggestions?
    (please remember I'm at the basic level so far..)

    Drag a rectangle in the Menu editor window to make a button. Type the text you want to appear in the Text section of the Inspector palette. Then select "Include Text in Highlight." You'll probably have to adjust the text position and the position of the button. You can change the highlight color with the Highlight pop-up just above the Text section of the Inspector palette.
    The text highlights that DVDSP makes are pretty rough; you would get smoother highlights doing the buttons and overlays separately in a graphics program.

  • Need Help creating a file download button

    Hello again,
    i am trying to make a button that when clicked will prompt
    the user to downalod a file to a target directory of the users
    choice. I have tried using URLRequest but it just opens the mp3 on
    another window with qiucktime which, i suspect, will happen with
    most users. is there a simple way to do this? i have no problem
    creating the button its just the function code for the button im
    lost on. thanks in advance
    Tim
    http://www.survivalsuit.org

    Check out the FileReference class... "The FileReference class
    provides a means to upload and download files between a user's
    computer and a server." (ActionScript 3.0 Language and Components
    Reference)
    At this moment, you know as much as I do about it, so I don't
    know if it's really what you need. But if it is, and you figure out
    the code, it'd be great if you put the coded solution here for the
    benefit of others (you know, pay it forward and all that).

  • Help please - phone icon only found in spotlight - how do i get it back!

    OK - so ,,,,I was moving my apps around to try get them organised and as i normally do i moved the 4 main apps off the bottom bar onto a page so i could then move icons onto the bottom bar to quickly move them to the new pages.... are you following me!
    Well I then started moving apps around all over the place but when i went to look for my 4 apps (phone, ipd, safari and mail) on a screen i couldn't find them anywhere. They can be found in spotlight but my question is.....how do i get the app icons back onto a screen!
    Please someone help

    If you have more than 180 apps, they won't all show on the screens. Try this:
    Start by resetting the home screen layout: Choose Settings -> General -> Reset and tap Reset Home Screen Layout. That will put the original icons back in their original positions. The rest you have to move manually.
    To get an icon to another page easily, with iPhone OS 3.0, you can drag the icon you want to move to the top right or top left corner of the page, and hold it there. The pages will keep flipping. When you've arrived to the page you want to add the app to, just move the icon away from the corner.

  • Help to create a Lucky Dip button, please?

    have developed a Football Pools competition to raise funds
    for various Good Causes and found a programmer to create the
    attached Flash file. Unfortunately he was involved in a serious car
    crash and will be hospitalised for many weeks.
    I apologise in advance - this may be a very inappropriate
    request ... I am not a programmer, just trying to find someone to
    help
    The last 2 parts he was undertaking were to
    1. create a "Lucky Dip" button that filled in randomly each
    of the required 15 choices .... to make life easy for non-fans, a
    button to press for a Lucky Dip selection BUT with the option to
    still change any individual choice they did not like
    2. Create a pop-up "warning" if anyone tried to submit an
    incomplete "entry" - forecasts are required for ALL 15 matches.
    I would be happy to pay a reasonable fee if this is again,
    not breeching etiquette.
    Thanks in advance for any help which will be much
    appreciated.
    My main email is [email protected]
    LINKS to files:
    SoccerBingo
    SWF
    fla file
    flp
    file

    have developed a Football Pools competition to raise funds
    for various Good Causes and found a programmer to create the
    attached Flash file. Unfortunately he was involved in a serious car
    crash and will be hospitalised for many weeks.
    I apologise in advance - this may be a very inappropriate
    request ... I am not a programmer, just trying to find someone to
    help
    The last 2 parts he was undertaking were to
    1. create a "Lucky Dip" button that filled in randomly each
    of the required 15 choices .... to make life easy for non-fans, a
    button to press for a Lucky Dip selection BUT with the option to
    still change any individual choice they did not like
    2. Create a pop-up "warning" if anyone tried to submit an
    incomplete "entry" - forecasts are required for ALL 15 matches.
    I would be happy to pay a reasonable fee if this is again,
    not breeching etiquette.
    Thanks in advance for any help which will be much
    appreciated.
    My main email is [email protected]
    LINKS to files:
    SoccerBingo
    SWF
    fla file
    flp
    file

  • Firefox frequently freezes. I can't click on anything (tabs, menu buttons, bookmarks, etc.) The only button that works is the upper right close button which when clicked will ask me if I want to "save & quit." Then I have to restart. Help fixing this?

    Frequently when I use Firefox it will all of a sudden freeze. It no longer will accept any user input from the keyboard or mouse. I cannot click on any of the open tabbed pages I have or on my bookmarks or any of the menu buttons. Nothing works. When it happens if it is loading a page it will just freeze in the middle of loading it. I've tried to see if the freezes are caused when it loads certain types of content (java, flash, etc...) but there seems to be no rhyme or reason as to when it happens or with what types of pages. I cannot find a pattern. The ONLY button that works is the close button in the upper right hand corner (X). I can click on that and then Firefox will prompt me with it's regular message asking me if I want to save and quit, quit, or cancel. I'll hit save and quit and then reopen Firefox. It opens my tabs and if I was in the middle of a post it generally will still remember the text I've typed (except Facebook!).
    It's beginning to drive me nuts and I'm really hoping to find a fix to this.

    You will also notice that your shift key will be emulated. Meaning that keys you will try to press will press but they will act like you are pressing the shift key when you are doing them.
    Try this, minimize the firefox window by pressing the tab on your taskbar. After doing that maximize it again. You will magically be able to click any link on your page. When you navigate to a new page however, the entire situation will start all over. My only remedy is rebooting and hoping it doesn't happen again soon.

  • HELP! How do I create a vertical scroll button for online banners?

    Hi, I am creating Flash online banners and the disclaimer needs to open as a vertical scroll banner once the mouse touches the 'x close' button where the words 'Disclaimer' is stated.
    How do I create a vertical scroll button including text?
    I am using Flash CS6.

    Hi Babaa,
    sry for the lateness of my reply.
    I would simply make a button that when clicked, displays a layer containing your disclaimer text. The discliamer text would be inside a Movie Clip (MC) for ease of controlling.
    the MC then contains a text field which has a scrollable field. as the user scrolls through you can then display a "close" button to close out the disclaimer MC.
    If you still need the work done feel free to email or PM me here and we can discuss the job further.
    Regards
    Russ

  • Bookmark toolbar will not display icons only

    downloaded the app to retain old look. In settings icons only is the default but still have the text.

    Add code to the <b>userChrome.css</b> file below the default @namespace line.
    *http://kb.mozillazine.org/userChrome.css
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #PlacesToolbarItems > .bookmark-item:not([container]) > .toolbarbutton-text{display:none !important}
    </nowiki></pre>
    The customization files userChrome.css (user interface) and userContent.css (websites) are located in the <b>chrome</b> folder in the Firefox profile folder.
    *http://kb.mozillazine.org/Editing_configuration
    You can use this button to go to the currently used Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder)
    * Create the chrome folder (lowercase) in the <xxxxxxxx>.default profile folder if this folder doesn't exist
    * Use a plain text editor like Notepad to create a (new) userChrome.css file in this folder (the names are case sensitive)
    * Paste the code in the userChrome.css file in the editor window and make sure that the userChrome.css file starts with the default @namespace line
    * Make sure that you select "All files" and not "Text files" when you save the file via "Save file as" in the text editor as userChrome.css. Otherwise Windows may add a hidden .txt file extension and you end up with a not working userChrome.css.txt file

  • Best App for Creating Flash Icons - Flash Builder?

    Hi,
    I have succeeded in creating some general iPad Folios but I am looking to add some icons for each section.  Namely an icon that flashes when presses and in turn changes when the associated section opens up.  For instance, I have created object states for text when selecting a button (converted to button / text or picture/icon).  Obviously simple to convert an image or text to a button but I guess it goes back to main question.  What is the best application in the Master Suite to create interactive icons?
    As a follow-up, can whomever provide any example of some killer icons, etc. as apps that I can download and view?
    Thanks in advance.
    MD

    bmwx5melissa wrote:
    Well I guess it helped me to know that maybe these differenet apps to help run flash is not perfect some flaws but I really wished that Apple would do something better for a perfect fit with a Flash and Ipad especially for homeschool programs! 
    Unfortunately, they won't. That is, you will have to live with the current, not very good, third-party solutions.
    bmwx5melissa wrote:
    My question about getting this App that you recommended (Puffin) WHAT DOES IT MEAN under you must be 17+ and some sexual content etc. etc.  I am really scared to get any App that states that?  Could you please explain what that means if I do get Puffin to help with my young daughter's homeschool.  I really would not care for her to see anything bad.  Are there any settings that I could prevent something undertand that statement?  Please let me know!  Thank you!
    It's just the standard disclaimer printed with each and every Web browser in the AppStore, not only Puffin. Don't pay attention.

  • How to create subpicture for a button?

    Hello!
    I have really tried to find the answer to this rather silly problem on my own, but without result. Please help someone!
    The situation:
    I have a menu with three choices: "Play Movie", "Scene Selection" and "Subtitles". Now, the text presenting these choices are part of the background image, created in Premiere (the program I know best). They are written with an old typewriter to get that gritty feeling.
    I want the user to scroll between these "menu items". The currently selected item should be indicated by a black circle/spot/dot before the text of the item. By default, when the menu appears, there is a black circle in front of (to the immediate left of) the item "Play Movie". The user should now be able to step with his/her remote to the other items, thereby making the black circle in front of "Play Movie" disappear and appearing instead before some of the other items. In short: the black circle is always showing before the currently selected item. OK, I got a bit verbose there, but the idea got across hopefully. One more thing: the background color is 100% white.
    Up to this point, my solution was this: I placed black circles (small images with gradation and all, very nice looking) in front of ALL THREE ITEMS. Then I convert these into buttons. Then I choose the color set for the menu so that the unselected state is 100% white, plain and simple, with 100% opacity, thereby covering the black circles that should not show. Only in the selected and activated states does opacity for the button subpicture drop to 0%, thereby revealing the black circle that should be seen.
    The problem? Well, on some DVD-players (not on the XBOX 360 though), when an item is activated, all three circles show for a brief moment before the selected action starts (for example playing the movie). It also happens in Encore Preview. This is not logical at all and looks amateurish. I don't know why it happens, but my guess is that it wouldn't if I did this the "correct" way: by creating subpictures fo the buttons in the shape of circles. I understand the nice looking gradations must go out the window but that is a price I'm willing to pay.
    But now I run into an unexpected problem: I don't understand how to create a subpicture for the button that is a black circle. It seems the documentation in Encore and on forums in general takes for granted that you know how to do this.
    What I tried ws this: I created a monochrome, small image in bmp format - a black circle on white background. But this image just shows up as a black rectangle in Encore.
    What should I do? I should add that I have no real experience with Photoshop, so go slow if you go there.
    Regards,
    Nikolaj

    Basically, when one realizes the limitations of the Sub-picture Highlights, as set by the DVD-specs., it's easy to see the "workaround."
    A couple of the aspects of Sub-picture Highlights are:
    1.) 2-bit color (either ON, or OFF), from a limited color palette, with degrees of Transparency (the opposite of PS's Opacity).
    2.) they will appear on top of anything else on the Menu, including things like Button text/graphics.
    By constructing your Sub-picture Highlight in PS, you can use Masking to define where it will be, and where it will not be. In the case that prompted my article, the poster had a series of Text Buttons, and the Sub-picture Highlights were formed from that Text. The poster did not like the look of those 2-bit jagged blocks of color overlying the Text in the Button. The workaround is to "punch a hole" in the Sub-picture Highlight, so that it is hollow, where the Button's Text appears. This is done in PS, by using the "outline" of that Text to create a Mask for the Sub-picture Highlight. The jagged aspect can be adjusted a bit, by using a degree of Transparency (set in the non-Auto Color Set back in Encore). We still have a 2-bit color Sub-picture Highlight, and it still overlays the Button's Text, but now there is a hole in it, right where the Button's Text is located, and it is seen through that hole. The introduction of Transparency has the visual effect of "softening" the look of the 2-bit color, even though the jagged edges are still there - they just look softer. I went on to show how one could even use a second Sub-picture Highlight, that is just a bit larger than the first, and with more Transparency to simulate a "glow." Now, we cannot have a real "glow," because we are limited to that 2-bit color for the Sub-picture Highlight, but we can simulate it.
    Much of what a designer does is really slight of hand - illusion. They all have to work within the limitations of the DVD (or BD) specs., but with a bit of creativity, planning and some work in PS and Encore, they can create enough smoke and use enough mirrors to fool the user into believing that what they think they see skirt the DVD-specs. They do not, but that's where the illusion comes in.
    We get a lot of questions from people, who claim that one commercial DVD, or another, has full-color Sub-picture Highlights and they complain that Encore cannot do that - only 2-bit Sub-picture Highlights. What they are seeing, but do not realize it, is a dupe Menu, with a full-color graphic, and no real Sub-picture Highlight visible. Jeff gives full details on doing this. Same for those who have seen a Button with a duo-tone thumbnail, that turns full-color, when the Button is navigated to. Wow, how did they do that, and why can't Adobe Encore do that? Well, what they saw was a dupe Menu, with a full-color thumbnail and no visible real Sub-picture Highlight.
    Jeff shows how to create what appears to be at least a 3-color Sub-picture Highlight. It's really just 3 regular 2-bit color Sub-picture Highlights, with Masking to create the illusion that he beat the DVD-specs. Neat! [Being from the USA, I also liked that he used the US flag, but he could have chosen the French "Tri-color," or any other flag, without artwork.]
    These are all just tricks, but if the user buys into the illusion, who's to know?
    Enjoy,
    Hunt
    PS - though many of the great, older posts were lost, when the forum changeover happened, I strongly suggest reading the posts here. You can bypass ones that do not offer you anything, but almost every possible illusion has been discussed at least one time, and likely many, with some different workflows offered by those, who replied. Great reading.

  • Setting icon for buttons in labview 6i

    Hi All,
    Currently i am working on Labview 6i. i created two buttons in my vi one button is used to perform the test, another will be used to exit from the test. i would like to add icons for those buttons. can anyone tell me how to add icons for buttons.
    Thanks,
    kalpana

    You realize that LabVIEW 6.0 is at least 15 years old? That would be almost equivalent to working with a Windows 98 machine nowadays!
    Yes your picture can't be imported in LabVIEW 6.0 on my machine either. I haven't checked about all the details, but the LabVIEW import in 6.0 doesn't seem to work for png and gif images but only for bmp. Newer versions do work for your png file including honoring the transparency at least since version 7.1.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to create the ICONS and SYMBOLS

    how to create the ICONS and SYMBOLS
    Title was edited by:
            Alvaro Tejada Galindo

    HI,
    Check this sample code....Not mine...
    REPORT SHOW_ICONS.
    TABLES: ICON.
    INCLUDE <ICON>.
    FIELD-SYMBOLS: <F>.
    SELECT * FROM ICON.
       ASSIGN (ICON-NAME) TO <F>.
       WRITE:   /(5) <F>, 20 '@',21 ICON-ID+1(2),23 '@',ICON-OLENG,
                ICON-BUTTON,ICON-STATUS,ICON-MESSAGE,ICON-FUNCTION,
                ICON-NAME.
    ENDSELECT.
    Also Try this,
    INCLUDE <symbol>.
    INCLUDE <icon>.
    Write:/ 'Phone Symbol:', SYM_PHONE AS SYMBOL.
    SKIP.
    WRITE: / 'Alarm Icon: ', icon_alarm AS ICON.
    For more information check out the following link it will help you.
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9e4a35c111d1829f0000e829fbfe/content.htm
    Regards,
    Padmam.

  • Smart Folders show icons only in Open Dialog pane

    Hi,
    I have created a couple of Smart Folders and put them in the side bar. When i select the Smart Folder, it shows the files and their preview icons. When i access the same Smart Folder in an Open Dialog pane from Keynote or another application, it shows regular file icons only, not the preview icons.
    Is this how it is supposed to work?

    While I'm not quite sure what you mean, it sounds to me like you had the Open dialog set for Column view, and at some point changed it to List view. Take a look at the toolbar at the top of the Open dialog window, you should see the back/forward buttons, then a group of three icons representing icon, list and column view. Both icon view and column view will show a preview icon of the selected file. Personally, I like icon view, since you see all the files that fit in the window with custom thumbs, and can pick what you want quickly. If you change the setting, in say Safari, to list view (which makes more sense in Safari), then the Open dialog for, say, TextEdit gets changed too. Just change it back by clicking the little icon in the toolbar at the top of the Open window.
    Francine
    Francine
    Schwieder

  • Desperately seeking help for displaying image on button

    i wrote the following method to create and display a button with an icon, doesn't work and i cannot figure out what the problem might be and how to fix it, please help me...
    clo :))
    public static void addButton(Container c, String title,
    ActionListener listener)
    JButton button = new JButton(title);
    button.setBorder(null);
    button.setFocusPainted(false);
    button.setBorderPainted(false);
    button.setContentAreaFilled(false);
    ImageIcon icon = new ImageIcon("anImage.jpg");
    button.setIcon(icon);
    c.add(button);
    button.addActionListener(listener);
    the parameter c is of JPanel type and gets added to a JFrame object,
    the source compiles and runs but i see no image on my button, sigh :((!
    PS(the image file is placed in the same dir as the source file).

    Why buttons and labels might not show up the icon?
    Either your image is not in the classpath and you are trying to load it as a resource: see
    http://java.sun.com/docs/books/tutorial/uiswing/misc/icon.html
    or you are running the java machine from a different directory that you expect it does.
    or the file doesn't exist.
    To prove that the system cannot load the image use the example in the above link and the url will be null.
    URL iconURL = ClassLoader.getSystemResource("anImage.jpg");

  • 2 questions - missing boot image, create mdt task sequence button missing

    I'm learning SCCM 2012.  I am watching a training video and the instructor shows a "Create MDT Task Sequence" button at the top of his ribbon bar when going into Task Sequence.  I do not have this button - where did it go?  I am
    using 2012 SP1.
    All I see is "Create Task Sequence" and "Create Task Sequence Media" but not "Create MDT Task Sequence".
    Also - I only have an x86 boot image, and no x64.  How do I get this into my inventory?
    Thank you
    Nathan

    "Create MDT Task Sequence" will be visible after you install MDT and integrate it to SCCM.
    MDT is different product and not part of default SCCM installation.
    You can integrate MDT to SCCM to create advanced Task Sequence if the default is not suitable for your needs. 
    Integrate MDT to SCCM.
    MDT latest version is 2013:
    http://www.microsoft.com/en-us/download/details.aspx?id=40796
    For creating x64 boot image:
    http://social.technet.microsoft.com/Forums/en-US/a3877a66-d35c-49ca-95c5-1c02d1611f2f/default-x64-boot-image-not-created-during-sccm-2012-setup
    Please take a moment to Vote as Helpful and/or Mark as Answer where applicable. Thanks.

Maybe you are looking for