Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


How to best design the UI?

Posted on 2003-11-18
Medium Priority
Last Modified: 2011-04-14
Hi all..

I have a project and I really need your help..

This program is to help the action desk handle complaints..

The first user interface will allow its user to specify his position..it will have two buttons (manager/employee)..

when the employee click on employee..an interface will appear and the employee will have to specify his name, id, and the problem details..he will also choose the complaint type (software/hardware) [two radio buttons]..and then send it to the manager by clicking [send] button..

After that the manager will enter his window..and he will have a list of technicians names to assign each compalint to a technician using automatic complaint number..
also the manager will be able to see (number, id, type, technicain name, date and status) for each complaint..and specify details

The program will have to show the date and calculate complaint number automatically..

Im thinking of having two lists..the manager will choose the complaint number from the first one..and choose a technician name to assign..and then all the other information will appear in a text area..

I want to ask about the best way in which I could design the manager interface and its different options..How will the manager be able to choose a complaint number, assign a technician to it..and show all the mentioned information..

Is there any other better way..? and how can I calculate the complaint number and date automatically?

waiting..and sorry if the question is too long

Question by:swet
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4

Expert Comment

ID: 9771776
You could actually handle the interface changing, (from manager to employee and back,) using a drop-down box with three choices:

Select Role

And then in a separate JPanel, you could populate the inputs of a manager and an employee pane based upone the valueChanged() event which gets spawned every time the value of the drop-down box changes.  The only trick is that you'd probably want to eliminate the "Select Role" option the moment they select one of the roles, or at least ignore it when the valueChanged() event shoots off.

As for the two lists, I'd also reccoment a drop down box.  It's small, succinct, and easy to dynamically populate, which will be good once technicians join and leave the company.  You can keep the list of them in a database, for example.

Speaking of databases, I assume you're using one to store the Action Desk complaints.  In that case, you can just create a column that automatically increments a number for you to designate the complaint number.

The last issue is the date.  That's actually trivial.  Just look up in the API java.util.Calendar.  The code to generate a date looks like this, more or less, depending on what format you want:

Calendar now = Calendar.newInstance();
int year = now.get( Calendar.YEAR );
int month = now.get( Calendar.MONTH );
int day = now.get( Calendar.DAY );

System.out.println( "Date is:\t" + month + "/" + day + "/" + year );

Author Comment

ID: 9771840
thanks very much..

but can you help me with some simple codes to use the drop-down box?

what do I have to do..Do I have to create three classes or only one..

I'm afriad I can't do it :(

and what is more..is that we havn't studied data bases yet..My teacher advised me to use vector..but Im still confused..

waiting to hear from you...


Expert Comment

ID: 9771859
Ah.  I just found it.  You want to register your Drop-Down List, ( with Select Role, Employee, and Manager, ) with the Listener Interface:


It has the one method:

valueChanged( ListSelectionEvent e )

Usually you actually have to register the Listener with your list's ListSelectionModel, which is easy enough to get:

ListSelectionModel myModel = myList.getSelectionModel();
myModel.addListSelectionListener( myListener );
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 9771889

So..when I will start my project..how many interfaces will I need..Will I need one for the drop down box, one for the manager, and one for the employee?

when I will select from the list say Manager..what will happened..will another window appear?

thanks in advance

Accepted Solution

SuperKarateMonkey earned 480 total points
ID: 9771970
Ah, I see where your skill level is now:

OK, first of all, bookmark this web page:


You should consider this the Holy Grail of java reference.  It has EVERY class you could ever worry about, and every method of every class.  This assumes you're working in J2SDK 1.4.2, of course, (you can see from the URL.)  If you're using a different JDK, just alter the URL, so if you're using 1.3.1, then make your URL:


etc. etc. etc...

Now, I'm not going to write your code for you, (this is class, you need to learn for yourself,) but I'll skeleton it out, which should provide some help.  Assuming you're using swing to create your GUI, you'll need to work with the javax.swing package:

1.  Create a JFrame

2.  Create 2 JPanels, add them to the JFrame, a small one, (30% of the JFrame,) on the left, and the bigger one on the right.

3.  Create a JList to add to the first JPanel on the left.  There are a 4 constructors.  Use the one:

JList( Vector listData )

A Vector is like an array, only it's resizable, and will automatically resize itself when you add more objects to it.  So you work with a vector like this:

Vector v = new Vector();
v.add( "Four" );
v.add( "Score" );
v.add( "And" );
v.add( "Seven" );
v.add( "Years" );
v.add( "Ago..." );

for( int i = 0; i < v.size(); i++ )
  System.out.println( (String)(v.get(i)) + " " );

This would print out:

Four Score And Seven Years Ago...

Anyway, that's a bit of overkill.  Point is, you can dynamically resize a Vector.

4.  Get the ListSelectionModel from the JList, register the ListSelectionListener to it.

5.  For the listener, write the code to populate the right hand JPanel whenever the valueChanged event fires off, with AI to determine what the resultant value is.  You might want to ignore the change if it returns to "Select One," or you might want to simply delete "Select One" from the list the first time the list changes, since at that point they've picked a horse.

That's about it for the skeleton code.  That should be enough for your to get started.

You might also want to look in the Sun's Swing Tutorial, located at:


Good luck.

Expert Comment

ID: 9772015
As for your specific questions, you need to be careful with terminology.  I'm not sure what you mean by "interfaces."  It doesn't sound like you're referring to the java definition of an interface, but rather UI components, (which is what you should call them:  UI Components.)

You'll need two completely separate routines to create the two UI's, one for the manager part and one for the employee part.  Probably the best way to handle that is to create them both, and add them both to two different JPanels, (making for a total of three:  The selector panel, the manager panel, and the employee panel.)  Then, when the selection of the list changes, you can just add the JPanel wholesale to the section on the right.  If it changes again, you just remove the entire panel that's currently there, and add the other one.  You'll need to explicitly keep track of which one is added, so that when you submit your data it doesn't use values from an irrelevant JPanel Component, but that's easily enough done.

Author Comment

ID: 9772016

thanks alot..

as you see..I'm just a begginer..

your explaination has helped me alot..

but I have a question..Do you mean that when I choose say (manager) from the left list..the right panel will show me the options of the manager?

Author Comment

ID: 9772038

Oh..thanks alot..

now I will try doing it :)

Expert Comment

ID: 9772061
OK.  Don't forget to close out the question when you finish, and good luck. :)

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question