BlueJ에서 만든 과제이며 BlueJ 패키지가 포함 된 zip 파일로 제출됩니다.gui에서 콘솔 프로그램을 시작하려면 어떻게합니까?
패키지에는 몇 가지 독립적 인 콘솔 프로그램이 있습니다. 나는 또 다른 "제어판"프로그램 (각 프로그램을 시작하는 라디오 버튼이있는 GUI)을 만들려고합니다.
는 여기에 내가 시도 리스너 클래스의 2 있습니다 : 사전에
private class RadioButtonListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
if(e.getSource() == arraySearchButton)
{
new ArraySearch();
}//end if
else if(e.getSource() == workerDemoButton)
{
new WorkerDemo();
}//end else if
}//end actionPerformed
}//end class RadioButtonListener
private class RunButtonListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
if(arraySearchButton.isSelected())
{
new ArraySearch();
}//end if
else if(workerDemoButton.isSelected())
{
new WorkerDemo();
}//end else if
}//end actionPerformed
}//end class RunButtonListener
감사합니다!
그래서 문제/질문은 무엇입니까? 예 : 무슨 일이 (또는 발생하지)? 어떻게 호출해야하는지 알 수 있습니까? WorkerDemo에 무엇이 있습니까? –
이 숙제가 있습니까? – Aaron
@pst 문제는 콘솔 창이 실행되지 않는다는 것입니다. 기술적으로 숙제가 완료되었습니다. –