Exception in thread "main" java.lang.IllegalArgumentException: illegal component position のエラーが発生します。frame.add(label, JFrame.CENTER) を実行すると機能しますが、変更すると機能しません。
package com.java;
import javax.swing.*;
import sun.audio.*;
import java.awt.*;
public class PlayClip extends JFrame{
public static void frame(){
JFrame frame = new JFrame("COLLIN");
frame.setSize(1086, 1200);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ImageIcon image = new ImageIcon("C:MYFILE");
JLabel label = new JLabel(image);frame.setResizable(false);
frame.add(label, JLabel.BOTTOM);
frame.setVisible(true);
}
public static void main(String[] args){
frame();
}
}