4 Replies - 366 Views - Last Post: 23 July 2019 - 12:44 PM Rate Topic: -----

#1 dako   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 60
  • Joined: 01-July 19

Button method to show icon

Posted 22 July 2019 - 10:42 PM

.setIcon() works with the JButton but the AWT Button class has no such method. Does anyone know the method to use a Image?
Is This A Good Question/Topic? 0
  • +

Replies To: Button method to show icon

#2 g00se   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3639
  • View blog
  • Posts: 16,718
  • Joined: 20-September 08

Re: Button method to show icon

Posted 23 July 2019 - 01:37 AM

Why on earth are you using an AWT Button?
Was This Post Helpful? 0
  • +
  • -

#3 dako   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 60
  • Joined: 01-July 19

Re: Button method to show icon

Posted 23 July 2019 - 07:15 AM

Because I couldn't figure out how to make the background of a JButton go away.
I actually figured it out its:

		btnLogin.setOpaque(false);
		btnLogin.setBorderPainted(false);
		btnLogin.setContentAreaFilled(false);



But I would still like to know how to use the Button. Is is deprecated?
Was This Post Helpful? 0
  • +
  • -

#4 g00se   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3639
  • View blog
  • Posts: 16,718
  • Joined: 20-September 08

Re: Button method to show icon

Posted 23 July 2019 - 10:13 AM

Quote

Is is deprecated?

Very much so. It belongs to the horse and cart era of Java
Was This Post Helpful? 1
  • +
  • -

#5 dako   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 60
  • Joined: 01-July 19

Re: Button method to show icon

Posted 23 July 2019 - 12:44 PM

Haha okay, good to know! These are the kind of posts that are helpful. Kind, not arrogant, and insightful.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1