Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a button, and a JTextPane. I want to toggle the displaying of a background image for the JTextPane on click of the button(using ActionListener).

Thanks in advance for the help.
Posted

1 solution

-assign an ActionListener
http://docs.oracle.com/javase/tutorial/uiswing/events/actionlistener.html[^]

- on the Action assign an Image to the GUI Control

http://docs.oracle.com/javase/tutorial/2d/images/index.html[^]

- not to forget: update the GUI to get the image visible.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900