Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Emulator using java swing

  1. #1
    Junior Member
    Join Date
    Apr 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Emulator using java swing

    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?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Emulator using java swing

    having problem with GUI
    Take a look at the tutorial on how to write a Swing GUI: Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Member
    Join Date
    Feb 2014
    Posts
    180
    Thanks
    0
    Thanked 48 Times in 45 Posts

    Default Re: Emulator using java swing

    It depends on your objectives. If you are tasked to develop a mobile phone simulator/emulator from scratch, then going through the Swing tutorial as Norm suggested will be a good start. If you only want to use a mobile phone emulator (and from the screenshot it appears to be a non-"smart" feature phone,) then you can use the SDK from the various phone vendors. E.g., in the recent past I've used LG's emulator that is available in their SDK: ::: LG Developer ::: . You can also check out 3 Emulators to Run Mobile Java Games & Apps on Windows PC and java me - how to Download different mobile phone simulators? - Stack Overflow although I'm not aware if any of them is open source (and I doubt they are.)

Similar Threads

  1. Question Regarding Android Emulator
    By kalaicse30@gmail.com in forum Android Development
    Replies: 3
    Last Post: December 5th, 2013, 06:47 AM
  2. Emulator not working
    By Karthik Prabhu in forum Android Development
    Replies: 2
    Last Post: May 18th, 2013, 06:33 AM
  3. Android emulator problem
    By dougie1809 in forum Java ME (Mobile Edition)
    Replies: 1
    Last Post: March 14th, 2013, 09:50 PM
  4. emulator
    By hedhili in forum Android Development
    Replies: 2
    Last Post: December 14th, 2012, 05:27 AM

Tags for this Thread