Skip to main content



      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 12:28 Go to next message
Eclipse UserFriend
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 12:44 Go to previous message
Eclipse UserFriend
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: Mon Apr 21 01:11:15 EDT 2025

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

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

Back to the top