オブジェクトを作成して、作成したパラメーターGUIオブジェクトとして作成した配列に追加しようとしています。何らかの理由で、TheDatesを変数に解決できません。
構築中のオブジェクト:
public static void main(String[] args)
{
DateDriver myDateFrame = new DateDriver();
}
//Constructor
public DateDriver()
{
outputFrame = new JFrame();
outputFrame.setSize(600, 500);
outputFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
String command;
Date [] theDates = new Date[100]; //this is the array I am having issues with
int month, day, year;
...
}
これは、theDatesに関する私の問題がどこにあるかです:
public void actionPerformed(ActionEvent e)
{ //The meat and Potatoes
if ( e.getSource() == arg3Ctor)
{
JOptionPane.showMessageDialog(null, "3 arg Constructor got it");
int month = Integer.parseInt(monthField.getText());
int day = Integer.parseInt(dayField.getText());
int year = Integer.parseInt(yearField.getText());
theDates[getIndex()] = new Date(month, day, year);//here is the actual issue
}
}
考えすぎているのか、何を考えているのかわかりません。配列を静的、パブリックなどにしようとしました。また、として実装しようとしましたmyDayeFrame.theDates
。
どんなガイダンスでも大歓迎です