11, setting the size of the JButton2 --Because Jbuten is a small device type, the general setsize can not be awakened to the size of the setting, so generally we use3Button.setpreferredsize (NewDimension (30,30));4 //(30,30) is the size of the button you want to set52, transparent settings for JButton6 --the button is set to transparent so that it does not block back background7Button.setcontentareafilled (false);83, set the border of the button to remove the JButton9 --If sometimes your button does not need a border because the border is beautiful or because you need to click the Previous button to render the normal imageTen after clicking, you can use this method to remove the border OneButton.setborderpainted (false); A4, add icons to JButton settings -——//instantiate an Icon object -ImageIcon image =NewImageIcon (Icons[i]); the //instantiates a button object and displays a picture on the Settings button -JButton button =NewJButton (image); - --or -Button.seticon (NewImageIcon (GetClass (). GetResource ("Qq.png"))); + //Qq.png is the picture you want to add -5, make the button change with the pattern on the button +Butten.setmargin (NewInsets (0,0,0,0)); A6, set up a convex button, and many other swing can also use this method at Butten.setborder (Borderfactory.createraisedbevelborder ()); -7, set up a concave button, and many other swing can use this method - Button.setborder (Borderfactory.createloweredbevelborder ()); -8, set the foreground and background color of the button -button. SetFont (NewJava.awt.Font ("XXFarEastFont-Xingkai", 1, 15)); - Button.setbackground (color.green); in9, change the style of the button -Uimanager.setlookandfeel ("Com.sun.java.swing.plaf.windows.WindowsLookAndFeel");