Search code examples
javaswingnetbeanscustom-controlslook-and-feel

customizing buttons in Netbeans


How can I add a custom look to my buttons? I'm using Netbeans and programming in Java. I mainly want to customize my buttons.


Solution

  • Do you want to just change the look of the buttons or actually draw new buttons yourself? If you just want to change the appearance ot something a bit nicer, then you probably just want to change the look and feel as detailed here: http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html

    There's also a number of 3rd party look and feel's you can use such as substance that look pretty swish.

    If you actually want to customise the appearance of the JButton itself and you just want to customise the JButtons then you can override paintComponent() in JButton to draw whatever you want as oppose to the default image.