//Object.java
//21/04/11
import javax.swing.JOptionPane;
//method to present the detail
class ObjectStore{
public void show(){
JOptionPane.showMessageDialog(null," a bike with marked code is 19"+
"/n owned by the person who lives at 14 King Road"+
"/n which is in police district 10","The bike
message",JOptionPane.PLAIN_MESSAGE);
}
//end the method to present the detail
}
public class Object1{
public static void main(String arg[]){
ObjectStore BikeInformation = new ObjectStore();
}
//end the main method
}
//end the class Object
以下为代码:
//Object.java
//21/04/11
import javax.swing.JOptionPane;
//method to present the detail
class ObjectStore{
public void show(){
JOptionPane.showMessageDialog(null," a bike with marked code is 19"+
"/n owned by the person who lives at 14 King Road"+
"/n which is in police district 10","The bike message",JOptionPane.PLAIN_MESSAGE);
}
//end the method to present the detail
}
public class Object1{
public static void main(String arg[]){
ObjectStore BikeInformation = new ObjectStore();
}
//end the main method
}
//end the class Object
正常跑完,但是对话框不弹出,求救大佬。
快别研究这些东西了,没有人用。。。
你只在main中创建了ObjectStore,没有调用它的方法吧