comboBox height and width settings
comboBox.setMaximumSize(new Dimension(100, 20));
comboBox.setMinimumSize(new Dimension(100, 20));
comboBox.setPreferredSize(new Dimension(100, 20));
Change image size in Swing
ImageIcon image=new ImageIcon("images\\icon.jpg");
image.setImage(image.getImage().getScaledInstance(20, 20, Image.SCALE_DEFAULT));
btnImage=ImageBundle.getImageIcon("button.png");
button = new JButton(btnImage);
button.setBorder(null);
button.setForeground(Color.BLACK);
button.setBackground(Color.BLACK);
button.setOpaque (true);
button.setContentAreaFilled(false);
button.setToolTipText("提示");