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.


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

Results 1 to 2 of 2

Thread: setVariable to Swing JTextfiled?

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

    Question setVariable to Swing JTextfiled?

    I'm basically trying to learn on my own.

    Have a Student.java class with set/get JOptionPane.showInputDailog("Some Questions");
    plus toString and print methods (both default constructors and User Input)
    (code finished)

    There are 8 questions with 7 String answers, and 1 double answer.

    I created a MyButton.java class with 3 JButtons. (code partially finished pending below)
    When the "Register Student" button is clicked.
    How can I get all the 8 Questions to show up in the one window,

    So user need only click OK once.

  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Thanked 833 Times in 772 Posts
    Blog Entries

    Default Re: setVariable to Swing JTextfiled?

    It sounds to me like you want to create a custom JDialog or JFrame. The following link provides tutorials on how to use Swing components: Lesson: Using Swing Components (The Java™ Tutorials > Creating a GUI With JFC/Swing) There are many different links there, of interest to you may be the JFrame, TextField, and button links.

Similar Threads

  1. Could need some help with Swing
    By Kerr in forum AWT / Java Swing
    Replies: 2
    Last Post: March 10th, 2011, 10:11 AM
  2. IO-swing problem
    By haresh2906 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 23rd, 2011, 07:00 AM
  3. Swing app gui optimization
    By nik_meback in forum AWT / Java Swing
    Replies: 1
    Last Post: December 6th, 2010, 12:55 PM
  4. Swing
    By waboke in forum AWT / Java Swing
    Replies: 2
    Last Post: November 3rd, 2010, 08:55 AM
  5. Text in Swing
    By whoismrsaxon in forum AWT / Java Swing
    Replies: 4
    Last Post: March 26th, 2010, 07:22 AM