1

I have to create an xml file based on the value of attributes set by user in dialog of Java Swing.There are five attributes name,age,sex,date of birth and place. when the user clicks on OK button of the Dialog box an xml file should be created in the temp directory of the user.

Kindly help me as I am new to Java Swing

Regards, Kumar

2 Answers 2

1

Create a GUI with controls to collect the data you specified. Create a class to generate the XML output. Call this class.

Sign up to request clarification or add additional context in comments.

Comments

1

To build a Swing GUI, you start with a JFrame.

Within this JFrame, you have a master JPanel.

The attributes will each have JLabel components and JTextField components. You will use a layout manager to arrange the label and text field components.

You have a JButton so that the user can tell your program that she's entered all of the attributes.

You should be able to look up all these Swing components and build a GUI.

Then, as jzd said, you create a class to generate the XML output and call this class from the GUI.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.