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 2 of 2

Thread: Using JFrame interfaces

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Using JFrame interfaces

    Hi,

    I'm new to Java, and I'm trying to make a basic app.

    I need to do the following.

    I have SendMessage.java and View.java.

    A button in View.java hides View.java, and now im trying to put a piece of code that shows a new JFrame i made called Confirm.java.

    Here is what my files look like (not all code just the essential):

    SendMessage.java
    public class SendMessage {
     
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            View showView = new View();
            showView.setVisible(true);
     
            Confirm showConfirm = new Confirm();
            showConfirm.setVisible(false);
        }
    }

    View.java
    public class View extends javax.swing.JFrame {
     
        /**
         * Creates new form View
         */
        public View() {
            initComponents();
        }
     
     
        @SuppressWarnings("unchecked")
     
     
        private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            setVisible(false);
            // I guess I need to put something here! <---------------------------------------------
            System.out.println(jTextField1.getText());
            System.out.println();
            System.out.println(jTextField2.getText());
            System.out.println();
            System.out.println(jTextArea2.getText());
        }

    Confirm.java doesn't have anything yet.

    I'm sure its an easy one.

    Thanks for all your help!

    Andreas


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,337
    Thanks
    182
    Thanked 830 Times in 773 Posts
    Blog Entries
    5

    Default Re: Using JFrame interfaces

    This thread has been cross posted here:

    http://www.java-forums.org/new-java/55039-easy-playing-jframe-interfaces.html

    Although cross posting is allowed, for everyone's benefit, please read:

    Java Programming Forums Cross Posting Rules

    The Problems With Cross Posting


Similar Threads

  1. Interfaces
    By TP-Oreilly in forum Java Theory & Questions
    Replies: 13
    Last Post: December 7th, 2011, 06:58 PM
  2. About abstract, interfaces, and when i should use this.
    By Yoga Herawan in forum Object Oriented Programming
    Replies: 2
    Last Post: October 4th, 2011, 10:38 AM
  3. marker interfaces
    By anupam0021 in forum Java Theory & Questions
    Replies: 1
    Last Post: April 20th, 2011, 06:53 PM
  4. Interfaces
    By leyland in forum Java Theory & Questions
    Replies: 4
    Last Post: April 5th, 2011, 08:51 PM
  5. Can't understand why Interfaces are there
    By vortexnl in forum Object Oriented Programming
    Replies: 9
    Last Post: February 14th, 2011, 12:06 PM

Tags for this Thread