Hi, code is here, generated by JFrameBuilder,
http://www.mars3000.com
Code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class QuestionsWin extends JFrame
{
private JTabbedPane jTabbedPane1;
private JPanel contentPane;
//-----
private JTextArea jTextArea1;
private JPanel jPanel1;
//-----
private JPanel jPanel2;
//-----
private JPanel jPanel3;
//-----
private JLabel jLabel1;
private JTextField txf_answer;
private JPanel jPanel4;
//-----
private JPanel jPanel5;
//-----
public QuestionsWin()
{
super();
initializeComponent();
this.setVisible(true);
}
private void initializeComponent()
{
jTabbedPane1 = new JTabbedPane();
contentPane = (JPanel)this.getContentPane();
//-----
jTextArea1 = new JTextArea();
jPanel1 = new JPanel();
//-----
jPanel2 = new JPanel();
//-----
jPanel3 = new JPanel();
//-----
jLabel1 = new JLabel();
txf_answer = new JTextField();
jPanel4 = new JPanel();
//-----
jPanel5 = new JPanel();
//-----
//
// jTabbedPane1
//
jTabbedPane1.addTab("Question 1", jPanel1);
jTabbedPane1.addTab("Question 2", jPanel2);
jTabbedPane1.addTab("Question 3", jPanel3);
jTabbedPane1.addTab("Question 4", jPanel5);
jTabbedPane1.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
//
// contentPane
//
contentPane.setLayout(new BorderLayout(0, 0));
contentPane.add(jTabbedPane1, BorderLayout.CENTER);
//
// jTextArea1
//
jTextArea1.setOpaque(false);
jTextArea1.setText("Why ..... ............ ........................ .......... ........... ........ .............. .......... ..............?");
jTextArea1.setEditable(false);
jTextArea1.setLineWrap(true);
jTextArea1.setWrapStyleWord(true);
//
// jPanel1
//
jPanel1.setLayout(new BorderLayout(0, 0));
jPanel1.add(jPanel4, BorderLayout.SOUTH);
jPanel1.add(jTextArea1, BorderLayout.CENTER);
//
// jPanel2
//
jPanel2.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
//
// jPanel3
//
jPanel3.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
//
// jLabel1
//
jLabel1.setText("Answer: ");
//
// txf_answer
//
txf_answer.setText("");
txf_answer.setToolTipText("Answer the question.");
txf_answer.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
txf_answer_actionPerformed(e);
}
});
//
// jPanel4
//
jPanel4.setLayout(new BorderLayout(0, 0));
jPanel4.add(jLabel1, BorderLayout.WEST);
jPanel4.add(txf_answer, BorderLayout.CENTER);
//
// jPanel5
//
jPanel5.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
//
// QuestionsWin
//
this.setTitle("QuestionsWin");
this.setLocation(new Point(176, 100));
this.setSize(new Dimension(298, 208));
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
//
// TODO: Add any appropriate code in the following Event Handling Methods
//
private void txf_answer_actionPerformed(ActionEvent e)
{
// TODO: Add any handling code here
}
//============================= Testing ================================//
public static void main(String[] args)
{
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
try
{
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
}
catch (Exception ex)
{
System.out.println("Failed loading L&F: ");
System.out.println(ex);
}
new QuestionsWin();
}
//= End of Testing =
}