To prevent spam users, you can only post on this forum after registration, which is by invitation. If you want to post on the forum, please send me a mail (h DOT m DOT w DOT verbeek AT tue DOT nl) and I'll send you an invitation in return for an account.
How to use an image on a button
Hi
I would like to create a button with only an icon on it. I've made icons and have put them in the folder of my java files. But how can I use it on buttons?
This is my code
JButton b = newButton(new ImageIcon("up.jpg"),"move down");
...
protected JButton newButton(ImageIcon icon, String tooltip) {
JButton b = new SlickerButton(icon);
b.setToolTipText(tooltip);
b.setForeground(new Color(40, 40, 40));
return b;
}
There is no error (not at compile time, not at runtime), but I get an empty button.
I've also tried different paths to the image, but with no success
- /LogMerge/src/org/processmining/plugins/logmerge/rulebasedmerger/up.jpg
- LogMerge/src/org/processmining/plugins/logmerge/rulebasedmerger/up.jpg
- src/org/processmining/plugins/logmerge/rulebasedmerger/up.jpg
- logmerge/rulebasedmerger/up.jpg
- rulebasedmerger/up.jpg
- up.jpg
I've also tried the same stuff with JButton instead of SlickerButton, but with no success.
Any suggestions?
Jan Claes
Ghent University, Belgium
Howdy, Stranger!
Categories
- 1.6K All Categories
- 45 Announcements / News
- 225 Process Mining
- 6 - BPI Challenge 2020
- 9 - BPI Challenge 2019
- 24 - BPI Challenge 2018
- 27 - BPI Challenge 2017
- 8 - BPI Challenge 2016
- 68 Research
- 1K ProM 6
- 393 - Usage
- 287 - Development
- 9 RapidProM
- 1 - Usage
- 7 - Development
- 54 ProM5
- 19 - Usage
- 187 Event Logs
- 32 - ProMimport
- 75 - XESame