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: Help with GUIs please & methods

  1. #1
    Junior Member
    Join Date
    Jan 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with GUIs please & methods

    Hi, I am creating a GUI for my java term project. This GUI is supposed to represent a database of students and teachers, and an user can edit this database if they would like. I have been taking my java class for 5 months now, but I have been doing extremely bad in it, and I barely understand any of it, so please excuse me if my question seem obvious.

    GUi question:
    1). After a long time I have been able to create three buttons, which represent teacher, student and other staff. I equipped each button with a button listener, but I need to open another GUI box which will allow the user selected people to be edited. For instance, if the user presses on the teacher, I want to open another box where the user can enter the teacher's name, address, experience etc. I don't really know what to do after this. I don't know what I have to do to open another GUI box, for adding/deleting people from the database.

    2). Which brings me to my second method question. I am really confused as to what my method should be for adding/deleting a teacher. But I thought that I should create a method which returns an ArrayList<String>. This is what i have so far, but I think it is TOTALLY wrong:
      public ArrayList<String> addTeacher (String name, String address, String classes, String department, int years, int salary)
      {
        ArrayList<String> teacherList = new ArrayList<String>();
        teacherList.add(new String (name + address + classes+ department + years + salary));
     
        return teacherList;
      }
    Any constructive criticism and help is welcomed. If you can help, I will be in your favor.
    Last edited by helloworld922; January 24th, 2010 at 01:56 AM.


  2. #2
    Junior Member shadihrr's Avatar
    Join Date
    Jan 2010
    Location
    home
    Posts
    23
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Help with GUIs please & methods

    I guess you have to write three GUI classes, student, teacher and staffs and when you run each button the listener should call them. or you could repaint your GUI and add the relevant table to your current GUI.therefor it's cool to add more than one panel in order to repaint just one panel .
    Last edited by shadihrr; February 2nd, 2010 at 07:24 AM.

Similar Threads

  1. Using variables from different methods?
    By Morevan in forum Object Oriented Programming
    Replies: 3
    Last Post: January 5th, 2010, 07:10 PM
  2. Working with Methods
    By duckman in forum Object Oriented Programming
    Replies: 3
    Last Post: November 9th, 2009, 08:27 PM
  3. User Defined Methods
    By mgutierrez19 in forum Object Oriented Programming
    Replies: 11
    Last Post: October 20th, 2009, 06:57 PM
  4. Novice with java methods, please help!
    By raidcomputer in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 14th, 2009, 04:23 AM
  5. numerical conversion methods..
    By chronoz13 in forum Java SE APIs
    Replies: 12
    Last Post: September 27th, 2009, 04:29 AM