Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How do I use my own icon in a JButton?(I want to use my own .gif or .png file to define the glyph in a toolbar JButton)
How do I use my own icon in a JButton? [message #1696805] Thu, 28 May 2015 16:28 Go to next message
Robert Thompson is currently offline Robert ThompsonFriend
Messages: 1
Registered: May 2015
Junior Member
When I click on "Icon" in the properties window, it gives me a choice of "class path resource", "Absolute path in file system", "No image" and "Default image".

Absolute path seems like the logical choice, but there's a message next to it that says "use only for quick testing, never use in a real application".

"Class path resource" gives me a choice of two system .jar files with pre-defined images.

The other two options use no image at all.

I tried copying my .png file to "bin" and "src", to no avail. There seems to be no way to use my own image in an icon.

Can anyone tell me what I'm missing? I'm new to eclipse and relatively new to Java itself, so a lot of things are unfamiliar to me. I come from a Delphi background.
Re: How do I use my own icon in a JButton? [message #1696811 is a reply to message #1696805] Thu, 28 May 2015 16:44 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
Are you talking about WindowBuilder, the WYSIWYG GUI editor in Eclipse? If so, you should probably post the question on the WindowBuilder or SWT forums.
Previous Topic:Eclipse crash with RHEL 2.6.32-504.el6.i686
Next Topic:Bug when I run a current project
Goto Forum:
  


Current Time: Thu Sep 26 03:28:57 GMT 2024

Powered by FUDForum. Page generated in 0.02607 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top