JComboBox change shapes and colors
问题 Right now I have a program that can move a rectangle left and right. I would like to make a JComboBox to change the shape and color of the object. public class DrawShapes extends JFrame{ //code private CanvasDrawArea canvas; // the custom drawing canvas (extends JPanel) /** Constructor to set up the GUI */ public DrawShapes() { // Panel for JComboBox and buttons JPanel btnPanel = new JPanel(new FlowLayout()); JComboBox shapes = new JComboBox(shapeName); btnPanel.add(shapes); //code for left