im makeing a java program as part of a tutorial this assignment is to make a blank GUI with the title "SalutionMondo" my code is here
import javax.swing.*; public class SalutonFrame extends JFrame { public SalutonFrame () { super("Saluton Mondo"); setSize(350, 100); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public static void main(String[] args) { SalutonFrame sal = new SalutonFrame(); } }
when i run the file nothing happens what is wrong
Offline
never mind i found problem
Offline
//you may want java.awt.* as well, depends on your project import javax.swing.*; public class SalutonFrame extends JFrame { public SalutonFrame () { super("Saluton Mondo"); setSize(350, 100); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setVisible(true); } public static void main(String[] args) { SalutonFrame sal = new SalutonFrame(); } public void paint(Graphics g) { super.paint(g); //do all your painting code here } }
Or, you can do this^
EDIT: wait you found the problem. nvm
Last edited by SJRCS_011 (2012-04-28 07:35:29)
Offline