public void rotateGUI() {
JFrame rotateFrame = new JFrame("Image Rotation");
JRadioButton rotateLeft = new JRadioButton("Rotate Left");
JRadioButton rotateRight = new JRadioButton("Rotate Right");
JRadioButton upsideDown = new JRadioButton("Rotate Upside Down");
JButton submit = new JButton("Submit");
ButtonGroup rotateButtons = new ButtonGroup();
rotateLeft.setBounds(120,30,120,50);
rotateRight.setBounds(120,30,120,50);
upsideDown.setBounds(120,30,120,50);
submit.setBounds(125,90,80,30);
rotateFrame.add(rotateLeft);
rotateFrame.add(rotateRight);
rotateFrame.add(upsideDown);
rotateFrame.add(submit);
rotateButtons.add(rotateLeft);
rotateButtons.add(rotateRight);
rotateButtons.add(upsideDown);
submit.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
if (rotateLeft.isSelected()) {
rotationAngle = 90;
}
else if (upsideDown.isSelected()) {
rotationAngle = 180;
}
else if (rotateRight.isSelected()){
rotationAngle = 270;
}
}
});
rotateFrame.setBounds(200, 200, 400, 200);
rotateFrame.setVisible(true);
Я пытаюсь создать фрейм с 3-мя переключателями и кнопкой отправки, но независимо от того, что я делаю при запуске, это просто кадр с большой кнопкой отправки. Что не так с моим кодом? Заранее спасибо.