Thank You for your reply!
I write it in Java Language, yes i launch then all in the same time, every program will not require very much processor time, because if i run it in one language it is almost OK, working very normally, I am using DELL laptop i5 2.67GHz processor with 4GB RAM, and Java 1.7 JDK. each program just doing as an Automatic Transfer Money machine is do, namely (Deposit, Withdraw, Transfer money, Balance in Query, Exit) i think it is not much complex, there is three classes for each language, and three classes which every language shared like Database class which has the get Connection and so on method which is used by these three languages. and at the end one other class is used to collect these three languages to one, the class name is AllInOneFrame, the other classes is extended JPanel, and implements Key, Action, and Mouse Listeners, and the AllInOneFrame class is extended the JFrame, when i run this class the CPU usage dramatically goes to 100, and Computer become very slow.... I don't if there is any way to post the Project, because if i post the entire code it is very long, but i will post the last AllInOneFrame class for more information. thank you
package com.ustb;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
import javax.swing.*;
import javax.swing.border.Border;
public class AllInOneFrame extends JFrame implements ActionListener, MouseListener {
private static final long serialVersionUID = 1L;
static JPanel cards;
private JPanel panel1, panel2, panel3;
private static JPanel panel4 = new JPanel();
private JButton englishButton = new JButton("English");
private JButton chinesehButton = new JButton("中文");
private JButton persianhButton = new JButton("فارسی");
private ImageIcon Up = new ImageIcon(getClass().getResource("image/Up.png"));
private ImageIcon Up2 = new ImageIcon(getClass().getResource(
"image/Up2.png"));
private ImageIcon Do = new ImageIcon(getClass().getResource("image/Do.png"));
private ImageIcon Do2 = new ImageIcon(getClass().getResource(
"image/Do2.png"));
private JLabel lableAdvertizeUp = new JLabel(Up);
private JLabel lableAdvertizeDo = new JLabel(Do);
private JLabel label = new JLabel();
Border border = BorderFactory.createRaisedBevelBorder();
ATMEnglish english = new ATMEnglish();
ATMChinese chinese = new ATMChinese();
ATMPersian persian = new ATMPersian();
static boolean error;
static boolean reSet = false;
static ArrayList<String> errorIDList = new ArrayList<String>();
Border border1 = BorderFactory.createLoweredBevelBorder();
public AllInOneFrame() {
panel1 = new JPanel(new FlowLayout());
panel1.add(englishButton);
panel1.add(chinesehButton);
panel1.add(persianhButton);
englishButton.setBackground(Color.decode("#800000" ));
chinesehButton.setBackground(Color.decode("#800000 "));
persianhButton.setBackground(Color.decode("#800000 "));
englishButton.setBorder(border1);
chinesehButton.setBorder(border1);
persianhButton.setBorder(border1);
MyFonts.setLabelFont(englishButton, Color.WHITE, 40);
MyFonts.setLabelFont(chinesehButton, Color.WHITE, 40);
MyFonts.setLabelFont(persianhButton, Color.WHITE, 40);
MyFonts.setComponentFont(panel1, "#0000A0", Color.BLACK, null, 0);
JLabel eng = new JLabel("Please Select Your Language", JLabel.CENTER);
JLabel chn = new JLabel("请选择语言", JLabel.CENTER);
JLabel per = new JLabel("لطفاً زبان خودرا انتخاب کنید", JLabel.CENTER);
panel2 = new JPanel(new GridLayout(3, 0));
panel2.add(eng);
panel2.add(chn);
panel2.add(per);
MyFonts.setLabelFont(eng, Color.YELLOW, 50);
MyFonts.setLabelFont(chn, Color.YELLOW, 50);
MyFonts.setLabelFont(per, Color.YELLOW, 50);
MyFonts.setComponentFont(panel2, "#0000A0", Color.BLACK, null, 0);
panel3 = new JPanel(new BorderLayout());
panel3.add(panel2, BorderLayout.NORTH);
panel3.add(panel1, BorderLayout.CENTER);
panel4 = new JPanel(new BorderLayout());
panel4.add(panel3, BorderLayout.CENTER);
cards = new JPanel();
cards.setLayout(new CardLayout());
cards.add("first", label);
cards.add("center", panel4);
cards.add("one", english.englishPanel());
cards.add("two", chinese.chinesePanel());
cards.add("three", persian.persianPanel());
this.add(lableAdvertizeUp, BorderLayout.NORTH);
this.add(cards, BorderLayout.CENTER);
this.add(lableAdvertizeDo, BorderLayout.SOUTH);
this.setSize(800, 600);
this.setTitle("Auto Transfere Money");
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
this.setResizable(false);
this.setVisible(true);
englishButton.addActionListener(this);
chinesehButton.addActionListener(this);
persianhButton.addActionListener(this);
englishButton.addMouseListener(this);
chinesehButton.addMouseListener(this);
persianhButton.addMouseListener(this);
label.addMouseListener(this);
panel4.addMouseListener(this);
new Thread(new MyAnimations.MyAnimation2(lableAdvertizeUp,
lableAdvertizeDo, Up, Do, Up2, Do2)).start();
MyAnimations anim2 = new MyAnimations();
MyAnimations.MyAnimation3 animation2 = anim2.new MyAnimation3(label,"pic", 3);
new Thread(animation2).start();
//new Thread(new WrongPasswordLocker()).start();
}
public static void main(String[] args) {
new AllInOneFrame();
}
public class WrongPasswordLocker implements Runnable {
public void run() {
try {
while (true) {
for (int i = 1; i <= 60; i++) {
Thread.sleep(1000);
if(error) {
i = 1;
error = false;
}
}
if(errorIDList.size() == 0)
continue;
else {
errorIDList.clear();
}
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public void actionPerformed(ActionEvent e) {
if(e.getSource() == englishButton) {
english.startSeytem = true;
reSet = true;
((CardLayout) cards.getLayout()).show(cards, "one");
}
if(e.getSource() == chinesehButton) {
chinese.startSeytem = true;
reSet = true;
((CardLayout) cards.getLayout()).show(cards, "two");
}
if(e.getSource() == persianhButton) {
persian.startSeytem = true;
reSet = true;
((CardLayout) cards.getLayout()).show(cards, "three");
}
}
static void addListener() {
//panel4.addMouseListener(this);
}
public void mouseClicked(MouseEvent e) {
}
public void mouseEntered(MouseEvent e) {
if(e.getSource() == englishButton) {
englishButton.setBackground(Color.decode("#000000" ));
}
else if(e.getSource() == chinesehButton) {
chinesehButton.setBackground(Color.decode("#000000 "));
}
else if(e.getSource() == persianhButton) {
persianhButton.setBackground(Color.decode("#000000 "));
}
else if(e.getSource() == label)
((CardLayout) cards.getLayout()).show(cards, "center");
}
public void mouseExited(MouseEvent e) {
if(e.getSource() == englishButton)
englishButton.setBackground(Color.decode("#800000" ));
else if(e.getSource() == chinesehButton)
chinesehButton.setBackground(Color.decode("#800000 "));
else if(e.getSource() == persianhButton)
persianhButton.setBackground(Color.decode("#800000 "));
else if(e.getSource() == panel4)
((CardLayout) cards.getLayout()).show(cards, "first");
}
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
}