0 Replies Latest reply: Apr 22, 2014 12:37 AM by user13665938 RSS

    Emulator using java swing

    user13665938

      I desired to produce a GUI in Java swing which should be look like mobile phone and i wanted to handle all button and instead of screen i wanted to display jTextArea so user click on any button

      then it should be displayed on the screen.


      My code is like

      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
      ();
       
      }
      }


      Image is Mobile Phone Image which contains keypad and one screen and i wanted to handle this buttons and screens.

      So can any body suggest me what can I do? Or any open source simulator in Java?