|
|
I want to set an icon on a button within the Designer. How do I make the icon available in the Property Editor? |
| Gillmer Derge writes:
Create a member variable in your class for the icon:
Icon myIcon = new ImageIcon("my-icon.gif");
Now myIcon should show up in the icon combo box.
| |
| Stein Somers writes:
1. Load the icons in a separate class. This has to be done almost exactely like this, it seems. The icon variables have to be static, and have to be initialised on the spot, otherwise JBuilder Designer doesn't understand. public class Images {
public static final Icon logo = new ImageIcon(
Images.class.getResource("/images/logo.gif"));
public static final Icon pedist = new ImageIcon(
...
2. Link to these icons in the frame/dialog class, by adding members e.g.
public class AboutBox extends JDialog {
Icon logo = Images.logo;
3. Now Designer lists the icons in the combobox for Icon properties exactely as you would expect.
This seems to be the way Designer was supposed to be used, but I couldn't find information about it with the Borland search engine. | |
| [Append to This Answer] | |
| 2001-Apr-20 10:45am |
| Previous: |
|
| Next: |
|
| ||||||||
|
Java Community
Java Tools |
Code Central JB OpenTools |
Community Recent Threads |
Borland Chat Chat FAQ |
||||||||||||||
|
Feature Matrices 3.0 | 3.5 | 4.0 5.0 | 6.0 | 7.0 |
Shop for JBuilder |
JBuilder Downloads and reg keys |
Report Piracy | ||||||||||||||
|
Online Manuals 4.0 | 5.0 | 6.0 7.0 |
Borland DevSupport's Bug/RFE Form Quality Central Client |
JB Patches & Updates |
JBuilder FAQs TIs | ||||||||||||||
|
JBuilder Newsgroups |
Tamaracka's News Archive |
Mr. Haki's JBuilder Machine |
JGuru's JBuilder FAQ |
||||||||||||||
|
Sun's Bug Parade |
|||||||||||||||||
|
|||||||||||||||||