不能直接实现,但您可以通过将 ImageIcon 包装到 Button 中轻松实现。(arrow_down.png是向下的黑色箭头)
button = new JButton();
button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/icons/arrow_down.png")));
button.setBorderPainted(false);
button.setFocusPainted(false);
button.setContentAreaFilled(false);
Run Code Online (Sandbox Code Playgroud)