Results 1 to 3 of 3
  1. #1
    viosDeveloper is offline Member
    Join Date
    Oct 2012
    Rep Power

    Default virtual iphone code help

    Hi everybody! I have done console c++ programming for a year and decided to do gui java (since there both oop). my first project is a virtual iphone, but im having trouble with it. here is my code:
    Java Code:
    import java.awt.*;
    import java.awt.Color;
    import javax.swing.*;
    import javax.swing.border.*;
    public class VirtualIPhone
      public VirtualIPhone()
      private static void createWindow()
        JFrame frame = new JFrame("Virtual IPhone");
        Border lineBdr = BorderFactory.createLineBorder(, 10);
        JLabel textLabel = new JLabel("This is the screen", SwingConstants.CENTER);
        textLabel.setPreferredSize(new Dimension(260, 510));
        Container content = frame.getContentPane();
        frame.getContentPane().add(textLabel, BorderLayout.CENTER);
        frame.setLocation(700, 100);
      public static void main(String[] args)
        VirtualIPhone IPhoneScreen = new VirtualIPhone();
    its supposed to have a black border wrapped around it, but it wont work. why is that?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: virtual iphone code help

    Quote Originally Posted by viosDeveloper View Post
    its supposed to have a black border wrapped around it
    I don't see any code that might do that.

    Better go through the Swing tutorials and learn how to use borders; also go through the section on Concurrency in Swing and learn how to construct and manipulate Swing components on the EDT.
    Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)

    Any future questions you have after learning Swing should be posted in the AWT/Swing section.

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    viosDeveloper is offline Member
    Join Date
    Oct 2012
    Rep Power

Similar Threads

  1. When converting code into an iPhone app...
    By Gio D. in forum New To Java
    Replies: 0
    Last Post: 03-16-2010, 07:36 PM
  2. [Virtual KeyBoard] - Anybody know ?
    By Matheus Leandro Ferreira in forum Advanced Java
    Replies: 1
    Last Post: 09-30-2009, 08:22 PM
  3. Virtual table?
    By kblackwell in forum New To Java
    Replies: 4
    Last Post: 01-31-2009, 10:54 PM
  4. Too many virtual Machine
    By davantmay in forum Java Applets
    Replies: 1
    Last Post: 07-06-2007, 10:53 PM
  5. Virtual Machine To Pda
    By Heather in forum Advanced Java
    Replies: 2
    Last Post: 06-30-2007, 03:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts