0

Is it possible to make buttons in AWT transparent? I drew an image and aligned parts of it with buttons.

Button start = new Button ();
start.setBounds(98, 333, 326, 51);
start.setBackground(null);
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
rgstrdnny
  • 1
  • 4
  • Why use AWT? See [this answer](http://stackoverflow.com/questions/6255106/java-gui-listeners-without-awt/6255978#6255978) for many good reasons to abandon AWT using components in favor of Swing. – Andrew Thompson Sep 12 '15 at 13:35

2 Answers2

0

I do not know any method to make an awt.button transparent with a single line of code. But maybe a work around would be to place a label and add a click listener to the label ?

grahan
  • 2,148
  • 5
  • 29
  • 43
0

One workaround I figured was just to use a rectangle then add a mousepressed event.

This solution is if you are trying to get the background image to appear as a design for your button.

rgstrdnny
  • 1
  • 4