How to best design the UI?

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 will have two buttons (manager/employee)..

when the employee click on 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

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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 );
swetAuthor Commented:
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 that we havn't studied data bases yet..My teacher advised me to use vector..but Im still confused..

waiting to hear from you...

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 );
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

swetAuthor Commented:

So..when I will start my 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
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
swetAuthor Commented:

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?
swetAuthor Commented:

Oh..thanks alot..

now I will try doing it :)
OK.  Don't forget to close out the question when you finish, and good luck. :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.