我如何将方法字符串(printBestillingsordre)调用到另一个方法中并为其创建 JPanel
public String printBestillingsordre(){
JButton button = new JButton("Varemodtaget");
String temp = "";
for(HentbestillingsordreRegistrer hentboregistrer: hbor){
if(status == "Leveret"){
temp += "Bestillings Status: " + hentboregistrer.BestillingsStatus+" \n" +
"LeverandoerID: "+ hentboregistrer.LeverandoerID+" \n";
}else{
temp += hentboregistrer.BestillingsStatus+ button + "\n" +
"LeverandoerID: "+ hentboregistrer.LeverandoerID+" \n";
}
System.out.println(temp);
}
return temp;
}
进入这段代码
public JPanel HentOrdreGUI(){
JPanel info = new JPanel();
info.setLayout(new BorderLayout());
info.add(printBestillingsordre());
return null;
}
顺便说一句,这段代码还没有完成