package gui;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
public class Controller {
private FXMLLoader medicalRcord;
Pane pane;
Stage stageMedicalRecord;
Stage stageAppointmentClerk;
Stage stageMedicalStaff;
Stage stageAdminClerck;
@FXML private RadioButton medicalRecord;
@FXML private RadioButton appointmentClerk;
@FXML private RadioButton medicalStaff;
@FXML private RadioButton adminStaff;
@FXML private TextField password;
public void selectedMedicalRecord (ActionEvent event){
System.out.println("This work");
//medicalRecord.setSelected(true);
appointmentClerk.setSelected(false);
medicalStaff.setSelected(false);
adminStaff.setSelected(false);
}
public void selectedAppointmentCleck (ActionEvent event){
System.out.println("This work");
medicalRecord.setSelected(false);
//appointmentClerk.setSelected(true);
adminStaff.setSelected(false);
medicalStaff.setSelected(false);
}
public void selectedMedicalStaff (ActionEvent event){
System.out.println("This work");
medicalRecord.setSelected(false);
appointmentClerk.setSelected(false);
medicalStaff.setSelected(true);
adminStaff.setSelected(false);
}
public void selectedAdminStaff (ActionEvent event){
System.out.println("This work");
medicalRecord.setSelected(false);
appointmentClerk.setSelected(false);
medicalStaff.setSelected(false);
adminStaff.setSelected(true);
}
public void handleNext( ActionEvent event){
System.out.printf( "It is listening" );
try {
if(medicalRecord.isSelected()==true && password.getText().equalsIgnoreCase("1")){
stageMedicalRecord = new Stage();
medicalRcord = new FXMLLoader(getClass().getResource("medicalRcord.fxml"));
medicalRcord.getController();
Parent pane = medicalRcord.load();
stageMedicalRecord.setTitle("Medical Record Specialist ");
stageMedicalRecord.setScene(new Scene(pane, 1000, 600));
stageMedicalRecord.show();
stageMedicalRecord.setX(500);
}
if(appointmentClerk.isSelected()==true && password.getText().equalsIgnoreCase("2")){
stageAppointmentClerk = new Stage();
pane = new Pane();
stageAppointmentClerk.setTitle("Admission or Appointment Clerk ");
stageAppointmentClerk.setScene(new Scene(pane, 600, 600));
stageAppointmentClerk.show();
stageAppointmentClerk.setX(500);
}
if(adminStaff.isSelected()==true && password.getText().equalsIgnoreCase("4")){
stageAdminClerck = new Stage();
pane = new Pane();
stageAdminClerck.setTitle("Administrative Staff ");
stageAdminClerck.setScene(new Scene(pane, 600, 600));
stageAdminClerck.show();
stageAdminClerck.setX(500);
}
if(medicalStaff.isSelected()==true && password.getText().equalsIgnoreCase("3")){
stageMedicalStaff = new Stage();
pane = new Pane();
stageMedicalStaff.setTitle("Medical Staff ");
stageMedicalStaff.setScene(new Scene(pane, 600, 600));
stageMedicalStaff.show();
stageMedicalStaff.setX(500);
}
}
catch(Exception e) {
e.printStackTrace();
}
}
}
上面的代码是为我的capstone类运行一个虚拟应用程序,当我昨晚在我的桌面上运行它运行正常但现在我的笔记本电脑在eclipse它不会运行我从桌面导入eclipse安装了jdk但是我不知道还有什么可能是我迷失了语言
答案 0 :(得分:0)
愚蠢的问题,但你的笔记本电脑上有JRE吗?如果是这样,请确保您的环境路径变量正确。转到JRE或JDK文件中的bin目录,并将目录复制到路径变量。
OR, 尝试将jar文件作为可运行的jar文件或确保清单文件正确。希望这有效