I desired to produce a GUI in Java swing which should be look like mobile phone, as rendered under.
test.jpg
So now the user should press the buttons and he can see the operation on the given phone screen, like if user press button "1" then it should display on the screen.
public class SimulatorPanel extends JPanel { public static BufferedImage image; public SimulatorPanel () { super(); try { image = ImageIO.read(new File("C:\\Users\\Administrator\\Documents\\NetBeansProjects\\MobileSimulator\\mobile.png")); } catch (IOException e) { //Not handled. } } public void paintComponent(Graphics g) { Image image1 = image.getScaledInstance(this.getWidth(), this.getHeight(), java.awt.Image.SCALE_SMOOTH); g.drawImage(image1, 0, 0, null); repaint(); } }
Basically, I wanted to develop a mobile simulator, but I having problem with GUI only. So can any body suggest me what can I do? Or any open source simulator in Java?