-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserGuidePanel.java
More file actions
50 lines (45 loc) · 1.38 KB
/
Copy pathUserGuidePanel.java
File metadata and controls
50 lines (45 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* File :UserGuidePanel.java
* Project: Normalized T Score Calxulation.
* Purpose: Display user's guide in Normalized T score calculation
* Author : Wachara R.
* First Released: Tu 17 June 2008
* Last Updated : Tu 1 Dec 2009
*/
package tscoreApp;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class UserGuidePanel extends JPanel {
JButton cmdLanguageChange=new JButton("Thai");
JPanel buttonPanel = new JPanel();
JTextArea textArea = new JTextArea(25,38); // row , column
JTabbedPane parent;
String str, Tstr;
public UserGuidePanel(JTabbedPane parent, String str1, String str2) {
super();
setLayout(new BorderLayout());
this.parent=parent;
this.str = str1;
this.Tstr = str2;
cmdLanguageChange.setForeground(Color.gray);
textArea.setFont(new Font("Microsoft Sans Serif", Font.PLAIN, 12));
textArea.setEditable(false);
textArea.setTabSize(3);
textArea.setLineWrap(true);
if(cmdLanguageChange.getText() == "Thai") textArea.setText(str); else textArea.setText(Tstr);
cmdLanguageChange.addActionListener( new ActionListener() {
public void actionPerformed(ActionEvent e) {
if(cmdLanguageChange.getText()=="Thai"){
cmdLanguageChange.setText("English");
textArea.setText(Tstr);
} else {
cmdLanguageChange.setText("Thai");
textArea.setText(str);
}
}
});
buttonPanel.add(cmdLanguageChange);
this.add(buttonPanel, BorderLayout.NORTH);
this.add(textArea,BorderLayout.CENTER);
}
}