/*
* ChemEqView.java
*/
package chemeq;
import java.awt.Component;
import java.awt.ComponentOrientation;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Locale;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
/**
* The application's main frame.
*/
public class ChemEqView extends FrameView {
public ChemEqView(SingleFrameApplication app) {
super(app);
initComponents();
// status bar initialization - message timeout, idle icon and busy animation, etc
ResourceMap resourceMap = getResourceMap();
int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
messageTimer = new Timer(messageTimeout, new ActionListener() {
public void actionPerformed(ActionEvent e) {
statusMessageLabel.setText("");
}
});
messageTimer.setRepeats(false);
int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
for (int i = 0; i < busyIcons.length; i++) {
busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
}
busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
public void actionPerformed(ActionEvent e) {
busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
}
});
idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
// connecting action tasks to status bar via TaskMonitor
TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
String propertyName = evt.getPropertyName();
if ("started".equals(propertyName)) {
if (!busyIconTimer.isRunning()) {
statusAnimationLabel.setIcon(busyIcons[0]);
busyIconIndex = 0;
busyIconTimer.start();
}
progressBar.setVisible(true);
progressBar.setIndeterminate(true);
} else if ("done".equals(propertyName)) {
busyIconTimer.stop();
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
progressBar.setValue(0);
} else if ("message".equals(propertyName)) {
String text = (String) (evt.getNewValue());
statusMessageLabel.setText((text == null) ? "" : text);
messageTimer.restart();
} else if ("progress".equals(propertyName)) {
int value = (Integer) (evt.getNewValue());
progressBar.setVisible(true);
progressBar.setIndeterminate(false);
progressBar.setValue(value);
}
}
});
}
@Action
public void showAboutBox() {
if (aboutBox == null) {
JFrame mainFrame = ChemEqApp.getApplication().getMainFrame();
aboutBox = new ChemEqAboutBox(mainFrame);
aboutBox.setLocationRelativeTo(mainFrame);
}
ChemEqApp.getApplication().show(aboutBox);
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
////GEN-BEGIN:initComponents
private void initComponents() {
mainPanel = new javax.swing.JPanel();
jPanel1 = new javax.swing.JPanel();
jComboBox1 = new javax.swing.JComboBox();
jComboBox2 = new javax.swing.JComboBox();
jComboBox3 = new javax.swing.JComboBox();
jComboBox4 = new javax.swing.JComboBox();
jComboBox5 = new javax.swing.JComboBox();
jComboBox6 = new javax.swing.JComboBox();
jComboBox7 = new javax.swing.JComboBox();
jComboBox8 = new javax.swing.JComboBox();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
jLabel4 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
menuBar1 = new javax.swing.JMenuBar();
javax.swing.JMenu fileMenu = new javax.swing.JMenu();
javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
javax.swing.JMenu helpMenu1 = new javax.swing.JMenu();
javax.swing.JMenuItem aboutMenuItem1 = new javax.swing.JMenuItem();
statusPanel = new javax.swing.JPanel();
javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
statusMessageLabel = new javax.swing.JLabel();
statusAnimationLabel = new javax.swing.JLabel();
progressBar = new javax.swing.JProgressBar();
jDialog12 = new javax.swing.JDialog();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jDialog1 = new javax.swing.JDialog();
jPanel2 = new javax.swing.JPanel();
jScrollPane2 = new javax.swing.JScrollPane();
jEditorPane1 = new javax.swing.JEditorPane();
mainPanel.setName("mainPanel"); // NOI18N
mainPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(chemeq.ChemEqApp.class).getContext().getResourceMap(ChemEqView.class);
jPanel1.setBackground(resourceMap.getColor("jPanel1.background")); // NOI18N
jPanel1.setName("jPanel1"); // NOI18N
jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }));
jComboBox1.setVisible(false);
jComboBox1.setName("jComboBox1"); // NOI18N
jPanel1.add(jComboBox1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, 50, -1));
jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }));
jComboBox2.setName("jComboBox2"); // NOI18N
jComboBox2.setVisible(false);
jPanel1.add(jComboBox2, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 30, 50, -1));
jComboBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }));
jComboBox3.setName("jComboBox3"); // NOI18N
jComboBox3.setVisible(false);
jPanel1.add(jComboBox3, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 30, 50, -1));
jComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }));
jComboBox4.setName("jComboBox4"); // NOI18N
jComboBox4.setVisible(false);
jPanel1.add(jComboBox4, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 30, 50, -1));
jComboBox5.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-------------", "NaCl", "KF", "CuCO3", "Zn", "AgNO3", "HCl", "H2SO4", "H3PO4" }));
jComboBox5.setName("jComboBox5"); // NOI18N
jComboBox5.setVisible(false);
jPanel1.add(jComboBox5, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 30, -1, -1));
jComboBox6.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-------------", "Ba(OH)2", "Al(OH)3", "CaBr2", "NaNO2", "Li2SO3" }));
jComboBox6.setName("jComboBox6"); // NOI18N
jComboBox6.setVisible(false);
jPanel1.add(jComboBox6, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 30, -1, -1));
jComboBox7.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-------------", "Al2(SO4)3", "Al2(CO3)3", "AlCl3", "AlF3", "Ag2SO3", "AgOH", "AgNO2", "AgBr", "BaCO3", "BaSO4", "BaCl2", "CuSO3", "CaSO4", "CaF2", "CaCO3", "KNO2", "KOH", "LiCl", "Li2SO4", "LiF", "NaCl", "NaBr", "Na2SO4", "NaNO2", "Zn(OH)2", "ZnBr2", "Zn(NO2)2", "ZnSO3" }));
jComboBox7.setName("jComboBox7"); // NOI18N
jComboBox7.setVisible(false);
jPanel1.add(jComboBox7, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 30, -1, -1));
jComboBox8.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-------------", "Al", "Al(NO3)3", "Ba", "BaF2", "Ba(NO3)2", "Ca", "CaCl2", "CaF2", "Ca(NO3)2", "Cu(NO2)2", "Cu(OH)2", "CuBr2", "H2SO3", "H2SO4", "HNO2", "H2O", "HBr", "Na", "NaNO3", "Na2SO3", "NaBr", "NaOH", "NaF", "Na2CO3", "KBr", "K2SO3", "KOH", "Li", "LiNO3", "Li2CO3" }));
jComboBox8.setName("jComboBox8"); // NOI18N
jComboBox8.setVisible(false);
jPanel1.add(jComboBox8, new org.netbeans.lib.awtextra.AbsoluteConstraints(640, 30, -1, -1));
jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
jLabel1.setForeground(resourceMap.getColor("jLabel1.foreground")); // NOI18N
jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
jLabel1.setVisible(false);
jLabel1.setName("jLabel1"); // NOI18N
jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(184, 35, -1, -1));
jLabel2.setForeground(resourceMap.getColor("jLabel2.foreground")); // NOI18N
jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
jLabel2.setName("jLabel2"); // NOI18N
jLabel2.setVisible(false);
jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(564, 35, -1, -1));
jLabel3.setForeground(resourceMap.getColor("jLabel3.foreground")); // NOI18N
jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
jLabel3.setFont(new java.awt.Font("", 5,18));
jLabel3.setName("jLabel3"); // NOI18N
jLabel3.setVisible(false);
jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 40, 20, -1));
jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jPanel1.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 90, 131, -1));
jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jPanel1.add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 130, 131, -1));
jButton3.setText(resourceMap.getString("jButton3.text")); // NOI18N
jButton3.setName("jButton3"); // NOI18N
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jPanel1.add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 130, 131, -1));
jButton4.setText(resourceMap.getString("jButton4.text")); // NOI18N
jButton4.setName("jButton4"); // NOI18N
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jPanel1.add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 130, 131, -1));
jButton5.setText(resourceMap.getString("jButton5.text")); // NOI18N
jButton5.setName("jButton5"); // NOI18N
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});
jPanel1.add(jButton5, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 90, 131, -1));
jButton6.setText(resourceMap.getString("jButton6.text")); // NOI18N
jButton6.setName("jButton6"); // NOI18N
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});
jPanel1.add(jButton6, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 90, 131, -1));
jLabel4.setFont(resourceMap.getFont("jLabel4.font")); // NOI18N
jLabel4.setForeground(resourceMap.getColor("jLabel4.foreground")); // NOI18N
jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
jLabel4.setName("jLabel4"); // NOI18N
jLabel4.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 90, 190, 60));
jLabel6.setIcon(resourceMap.getIcon("jLabel6.icon")); // NOI18N
jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
jLabel6.setName("jLabel6"); // NOI18N
jPanel1.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 70, 100, 90));
jLabel5.setIcon(resourceMap.getIcon("jLabel5.icon")); // NOI18N
jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
jLabel5.setName("jLabel5"); // NOI18N
jPanel1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 780, 220));
mainPanel.add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(12, 0, 780, -1));
menuBar1.setName("menuBar1"); // NOI18N
menuBar1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
fileMenu.setName("fileMenu"); // NOI18N
javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(chemeq.ChemEqApp.class).getContext().getActionMap(ChemEqView.class, this);
exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
exitMenuItem.setText(resourceMap.getString("exitMenuItem.text")); // NOI18N
exitMenuItem.setName("exitMenuItem"); // NOI18N
fileMenu.add(exitMenuItem);
menuBar1.add(fileMenu);
helpMenu1.setText(resourceMap.getString("helpMenu1.text")); // NOI18N
helpMenu1.setActionCommand(resourceMap.getString("helpMenu1.actionCommand")); // NOI18N
helpMenu1.setName("helpMenu1"); // NOI18N
aboutMenuItem1.setAction(actionMap.get("showAboutBox")); // NOI18N
aboutMenuItem1.setText(resourceMap.getString("aboutMenuItem1.text")); // NOI18N
aboutMenuItem1.setName("aboutMenuItem1"); // NOI18N
aboutMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
aboutMenuItem1ActionPerformed(evt);
}
});
helpMenu1.add(aboutMenuItem1);
menuBar1.add(helpMenu1);
statusPanel.setName("statusPanel"); // NOI18N
statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N
statusMessageLabel.setName("statusMessageLabel"); // NOI18N
statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N
progressBar.setName("progressBar"); // NOI18N
javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
statusPanel.setLayout(statusPanelLayout);
statusPanelLayout.setHorizontalGroup(
statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 810, Short.MAX_VALUE)
.addGroup(statusPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(statusMessageLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 624, Short.MAX_VALUE)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(statusAnimationLabel)
.addContainerGap())
);
statusPanelLayout.setVerticalGroup(
statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(statusPanelLayout.createSequentialGroup()
.addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(statusMessageLabel)
.addComponent(statusAnimationLabel)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(3, 3, 3))
);
jDialog12.setTitle(resourceMap.getString("jDialog12.title")); // NOI18N
jDialog12.setName("jDialog12"); // NOI18N
jDialog12.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
jScrollPane1.setName("jScrollPane1"); // NOI18N
jTextArea1.setColumns(20);
jTextArea1.setEditable(false);
jTextArea1.setRows(5);
jTextArea1.setText(resourceMap.getString("jTextArea1.text")); // NOI18N
jTextArea1.setName("jTextArea1"); // NOI18N
jScrollPane1.setViewportView(jTextArea1);
javax.swing.GroupLayout jDialog12Layout = new javax.swing.GroupLayout(jDialog12.getContentPane());
jDialog12.getContentPane().setLayout(jDialog12Layout);
jDialog12Layout.setHorizontalGroup(
jDialog12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
);
jDialog12Layout.setVerticalGroup(
jDialog12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)
);
jDialog1.setMinimumSize(new java.awt.Dimension(800, 600));
jDialog1.setName("jDialog1"); // NOI18N
jPanel2.setName("jPanel2"); // NOI18N
jScrollPane2.setName("jScrollPane2"); // NOI18N
jEditorPane1.setName("jEditorPane1"); // NOI18N
jEditorPane1.setEditable(false);
try{
jEditorPane1 = new javax.swing.JEditorPane(getClass().getResource("/html/aa.html"));
}catch(Exception ex){}
jEditorPane1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
jEditorPane1.setFont(new java.awt.Font("Tahoma", 1, 18));
jScrollPane2.setViewportView(jEditorPane1);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 687, Short.MAX_VALUE)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
);
javax.swing.GroupLayout jDialog1Layout = new javax.swing.GroupLayout(jDialog1.getContentPane());
jDialog1.getContentPane().setLayout(jDialog1Layout);
jDialog1Layout.setHorizontalGroup(
jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDialog1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
jDialog1Layout.setVerticalGroup(
jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDialog1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
setComponent(mainPanel);
setMenuBar(menuBar1);
setStatusBar(statusPanel);
}// //GEN-END:initComponents
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("NaCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("BaCl2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("NaOH")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
// jDialog1.
// User has typed in a string; only possible with an editable combobox
//janeshini Doganeh
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("KF") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("KOH") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("BaF2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
// User has selected an item; it may be the same item
} else if (jComboBox1.getSelectedItem().equals("3") && jComboBox5.getSelectedItem().equals("NaCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("AlCl3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("NaOH")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("NaCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("NaBr") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("CaCl2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("0") && jComboBox5.getSelectedItem().equals("NaCl") && jComboBox2.getSelectedItem().equals("0") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("0") && jComboBox7.getSelectedItem().equals("-------------") && jComboBox4.getSelectedItem().equals("0") && jComboBox8.getSelectedItem().equals("-------------")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("NaCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("LiCl") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Na2SO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("KF") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("KOH") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("BaF2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("3") && jComboBox5.getSelectedItem().equals("KF") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("AlF3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("KOH")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("KF") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("CaF2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("KBr")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("KF") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("KNO2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("NaF")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("KF") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("LiF") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("K2SO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("CuCO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("BaCO3") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Cu(OH)2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("3") && jComboBox5.getSelectedItem().equals("CuCO3") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Al2(CO3)3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("Cu(OH)2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("CuCO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("CaCO3") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("CuBr2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("CuCO3") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Na2CO3") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Cu(NO2)2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("CuCO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("CuSO3") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Li2CO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("AgNO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("AgOH") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Ba(NO3)2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("3") && jComboBox5.getSelectedItem().equals("AgNO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("3") && jComboBox7.getSelectedItem().equals("AgOH") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Al(NO3)3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("AgNO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("AgBr") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Ca(NO3)2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("AgNO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("AgNO2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("NaNO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("AgNO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Ag2SO3") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("LiNO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("HCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("BaCl2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("3") && jComboBox5.getSelectedItem().equals("HCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("AlCl3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("HCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("CaCl2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("HBr")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("HCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("NaCl") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("HNO2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("HCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("LiCl") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("H2SO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
//H2SO4
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("H2SO4") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("BaSO4") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("3") && jComboBox5.getSelectedItem().equals("H2SO4") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Al(SO4)3") && jComboBox4.getSelectedItem().equals("6") && jComboBox8.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("H2SO4") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("CaSO4") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("HBr")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("H2SO4") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Na2SO4") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("HNO2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("H2SO4") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Li2SO4") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2SO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
//H3PO4
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("H3PO4") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Ba3(PO4)2") && jComboBox4.getSelectedItem().equals("6") && jComboBox8.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("H3PO4") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("AlPO4") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("H3PO4") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Ca3(PO4)2") && jComboBox4.getSelectedItem().equals("6") && jComboBox8.getSelectedItem().equals("HBr")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("H3PO4") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Na3PO4") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("HNO2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("H3PO4") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Li3PO4") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("H2SO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
//Zn
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Zn(OH)2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Ba")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("3") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("3") && jComboBox7.getSelectedItem().equals("Zn(OH)2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("Al")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("ZnBr2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Ca")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Zn(NO2)2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("Na")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("ZnSO3") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("Li")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
//End Zn
//End Janeshini Doganeh
//Start Janeshini sadeh
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CuSO4") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("ZnSO4") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Cu")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Al") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("CuSO4") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Al2(SO4)3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("Cu")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Na") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("NaOH") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Ca") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Ca(OH)2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Fe") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("HCl") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("FeCl2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Al") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("CuSO4") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Al2(SO4)3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("Cu")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("ZnO") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Al") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Al2O3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("F2") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("NaI") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("NaF") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("I2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Ca") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("HCl") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("CaCl2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Na") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("HCl") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("NaCl") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Al") && jComboBox2.getSelectedItem().equals("6") && jComboBox6.getSelectedItem().equals("HCl") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("AlCl3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Al") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("AgNO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Al(NO3)3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("Ag")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Al") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("NaI") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("AlI3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("Na")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("NaI") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("ZnI2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("Na")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("HCl") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("ZnCl2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("AgNO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Zn(NO3)2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("Ag")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
//End Janeshini sadeh
//Start tajzieh
} else if (jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaCO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("CaO") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("CO2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("H2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("O2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("HgO") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("Hg") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("O2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("NaCl") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("Na") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Cl2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("H2SO4") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("H2O") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("SO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Al2O3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
//End Tajzieh
//Start Tarkib
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("H2") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("O2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Na2O") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("NaOH")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("CaO") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Ca(OH)2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("SO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("H2SO4")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Na2O") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("O2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("Na2O2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Cu") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("O2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("CuO")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("4") && jComboBox5.getSelectedItem().equals("Cu") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("O2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("Cu2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("4") && jComboBox5.getSelectedItem().equals("Na") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("O2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("Na2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Na") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Cl2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("NaCl")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("H2") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Cl2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("HCl")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
//End Tarkib
} else if (jComboBox1.getSelectedItem().equals("0") && jComboBox5.getSelectedItem().equals("-------------") && jComboBox2.getSelectedItem().equals("0") && jComboBox6.getSelectedItem().equals("-------------") && jComboBox3.getSelectedItem().equals("0") && jComboBox7.getSelectedItem().equals("-------------") && jComboBox4.getSelectedItem().equals("0") && jComboBox8.getSelectedItem().equals("-------------")) {
//JOptionPane.showMessageDialog(null, "ابتدا از دو منو دوم و چهارم از سمت چپ دو ماده انتخاب کنید ،\nسپس بر اساس دو انتخاب اول از منو ششم و هشتم گزینه های \n درست را پیدا کنید و پس از آن از منو های اعداد ضرایب صحیح را\n انتخاب کرده بر روی دکمه (برسی درستی) کلیک کنید تا نتیجه را\n مشاهده کنید.\nهمان طور که می دانید در واکنش های جانشینی دوگانه زمانی یک\nواکنش انجام شدنی است که یکی از فراورده ها آب، گاز یا رسوب\nباشد. که این مسئله در این نرم افزار در نظر گرفته نشده است.\n\nلطفآ هر گونه اشکال یا پیشنهاد را به آدرس پستی زیر ارسال\nنمایید.\nکیان کیانی\nkian34@gmail.com\n۰۹۱۳۱۰۰۵۱۵۴", "راهنما", 1);
// jDialog12.setVisible(true);
this.showAboutBox();
} else {
JOptionPane.showMessageDialog(null, "اشتباه! دوباره سعی کن", "نه", 1);
}// TODO add your handling code here:
}//GEN-LAST:event_jButton1ActionPerformed
private void aboutMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutMenuItem1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_aboutMenuItem1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
jDialog1.setVisible(true); // TODO add your handling code here:
}//GEN-LAST:event_jButton2ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
//Janeshini doganeh
jComboBox1.setVisible(true);
jComboBox5.setVisible(true);
jLabel1.setVisible(true);
jComboBox2.setVisible(true);
jComboBox6.setVisible(true);
jLabel3.setVisible(true);
jComboBox3.setVisible(true);
jComboBox7.setVisible(true);
jLabel2.setVisible(true);
jComboBox4.setVisible(true);
jComboBox8.setVisible(true);
jLabel4.setText("واکنش جانشینی دوگانه");
jComboBox5.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "NaCl", "KF", "CuCO3", "AgNO3", "HCl", "H2SO4", "H3PO4"}));
jComboBox6.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Ba(OH)2", "Al(OH)3", "CaBr2", "NaNO2", "Li2SO3"}));
jComboBox7.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Al2(SO4)3", "Al2(CO3)3", "AlCl3", "AlF3", "Ag2SO3", "AgOH", "AgNO2", "AgBr", "BaCO3", "BaSO4", "BaCl2", "CuSO3", "CaSO4", "CaF2", "CaCO3", "KNO2", "KOH", "LiCl", "Li2SO4", "LiF", "NaCl", "NaBr", "Na2SO4", "NaNO2", "Zn(OH)2", "ZnBr2", "Zn(NO2)2", "ZnSO3"}));
jComboBox8.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Al(NO3)3", "BaF2", "Ba(NO3)2", "CaCl2", "CaF2", "Ca(NO3)2", "Cu(NO2)2", "Cu(OH)2", "CuBr2", "H2SO3", "H2SO4", "HNO2", "H2O", "HBr", "NaNO3", "Na2SO3", "NaBr", "NaOH", "NaF", "Na2CO3", "KBr", "K2SO3", "KOH", "LiNO3", "Li2CO3"}));
// TODO add your handling code here:
}//GEN-LAST:event_jButton3ActionPerformed
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
//Tajzieh
jComboBox1.setVisible(false);
jComboBox5.setVisible(false);
jLabel1.setVisible(false);
jComboBox2.setVisible(true);
jComboBox6.setVisible(true);
jLabel3.setVisible(true);
jComboBox3.setVisible(true);
jComboBox7.setVisible(true);
jLabel2.setVisible(true);
jComboBox4.setVisible(true);
jComboBox8.setVisible(true);
jLabel4.setText("واکنش تجزیه");
jComboBox6.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "CaCO3", "H2O", "HgO", "NaCl", "H2SO4", "Al(OH)3"}));
jComboBox7.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Na", "H2", "H2O", "Hg", "Al2O3", "CaO"}));
jComboBox8.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Cl2", "SO3", "H2O", "O2", "CO2"}));
// TODO add your handling code here:
}//GEN-LAST:event_jButton4ActionPerformed
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
//Tarkib
jComboBox1.setVisible(true);
jComboBox5.setVisible(true);
jLabel1.setVisible(true);
jComboBox2.setVisible(true);
jComboBox6.setVisible(true);
jLabel3.setVisible(true);
jComboBox3.setVisible(true);
jComboBox7.setVisible(true);
jLabel2.setVisible(false);
jComboBox4.setVisible(false);
jComboBox8.setVisible(false);
jLabel4.setText("واکنش ترکیب");
jComboBox5.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "H2", "Na2O", "CaO", "SO3", "Cu", "Na"}));
jComboBox6.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "O2", "H2O", "Cl2"}));
jComboBox7.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "NaCl", "Na2O", "HCl", "H2O", "Ca(OH)2", "NaOH", "H2SO4", "Na2O2", "CuO", "Cu2O"}));
// TODO add your handling code here:
}//GEN-LAST:event_jButton5ActionPerformed
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
//janeshini sadeh
jComboBox1.setVisible(true);
jComboBox5.setVisible(true);
jLabel1.setVisible(true);
jComboBox2.setVisible(true);
jComboBox6.setVisible(true);
jLabel3.setVisible(true);
jComboBox3.setVisible(true);
jComboBox7.setVisible(true);
jLabel2.setVisible(true);
jComboBox4.setVisible(true);
jComboBox8.setVisible(true);
jLabel4.setText("واکنش جانشینی ساده");
jComboBox5.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Zn", "Al", "Na", "Ca", "Fe", "F2"}));
jComboBox6.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "CuSO4", "AgNO3", "H2O", "HCl", "NaI"}));
jComboBox7.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Al(NO3)3", "Al2(SO4)3", "Al2O3", "AlCl3", "AlI3", "Ca(OH)2", "CaSO4", "CaCl2", "FeCl2", "NaOH", "NaF", "NaCl","ZnO", "ZnSO4", "ZnCl2" , "ZnI2", "Zn(NO3)2" }));
jComboBox8.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Cu", "Ag", "H2", "I2"}));
// TODO add your handling code here:
}//GEN-LAST:event_jButton6ActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JComboBox jComboBox1;
private javax.swing.JComboBox jComboBox2;
private javax.swing.JComboBox jComboBox3;
private javax.swing.JComboBox jComboBox4;
private javax.swing.JComboBox jComboBox5;
private javax.swing.JComboBox jComboBox6;
private javax.swing.JComboBox jComboBox7;
private javax.swing.JComboBox jComboBox8;
private javax.swing.JDialog jDialog1;
private javax.swing.JDialog jDialog12;
private javax.swing.JEditorPane jEditorPane1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JPanel mainPanel;
private javax.swing.JMenuBar menuBar1;
private javax.swing.JProgressBar progressBar;
private javax.swing.JLabel statusAnimationLabel;
private javax.swing.JLabel statusMessageLabel;
private javax.swing.JPanel statusPanel;
// End of variables declaration//GEN-END:variables
private final Timer messageTimer;
private final Timer busyIconTimer;
private final Icon idleIcon;
private final Icon[] busyIcons = new Icon[15];
private int busyIconIndex = 0;
private JDialog aboutBox;
}
* ChemEqView.java
*/
package chemeq;
import java.awt.Component;
import java.awt.ComponentOrientation;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Locale;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
/**
* The application's main frame.
*/
public class ChemEqView extends FrameView {
public ChemEqView(SingleFrameApplication app) {
super(app);
initComponents();
// status bar initialization - message timeout, idle icon and busy animation, etc
ResourceMap resourceMap = getResourceMap();
int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
messageTimer = new Timer(messageTimeout, new ActionListener() {
public void actionPerformed(ActionEvent e) {
statusMessageLabel.setText("");
}
});
messageTimer.setRepeats(false);
int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
for (int i = 0; i < busyIcons.length; i++) {
busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
}
busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
public void actionPerformed(ActionEvent e) {
busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
}
});
idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
// connecting action tasks to status bar via TaskMonitor
TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
String propertyName = evt.getPropertyName();
if ("started".equals(propertyName)) {
if (!busyIconTimer.isRunning()) {
statusAnimationLabel.setIcon(busyIcons[0]);
busyIconIndex = 0;
busyIconTimer.start();
}
progressBar.setVisible(true);
progressBar.setIndeterminate(true);
} else if ("done".equals(propertyName)) {
busyIconTimer.stop();
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
progressBar.setValue(0);
} else if ("message".equals(propertyName)) {
String text = (String) (evt.getNewValue());
statusMessageLabel.setText((text == null) ? "" : text);
messageTimer.restart();
} else if ("progress".equals(propertyName)) {
int value = (Integer) (evt.getNewValue());
progressBar.setVisible(true);
progressBar.setIndeterminate(false);
progressBar.setValue(value);
}
}
});
}
@Action
public void showAboutBox() {
if (aboutBox == null) {
JFrame mainFrame = ChemEqApp.getApplication().getMainFrame();
aboutBox = new ChemEqAboutBox(mainFrame);
aboutBox.setLocationRelativeTo(mainFrame);
}
ChemEqApp.getApplication().show(aboutBox);
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
//
private void initComponents() {
mainPanel = new javax.swing.JPanel();
jPanel1 = new javax.swing.JPanel();
jComboBox1 = new javax.swing.JComboBox();
jComboBox2 = new javax.swing.JComboBox();
jComboBox3 = new javax.swing.JComboBox();
jComboBox4 = new javax.swing.JComboBox();
jComboBox5 = new javax.swing.JComboBox();
jComboBox6 = new javax.swing.JComboBox();
jComboBox7 = new javax.swing.JComboBox();
jComboBox8 = new javax.swing.JComboBox();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jButton6 = new javax.swing.JButton();
jLabel4 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
menuBar1 = new javax.swing.JMenuBar();
javax.swing.JMenu fileMenu = new javax.swing.JMenu();
javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
javax.swing.JMenu helpMenu1 = new javax.swing.JMenu();
javax.swing.JMenuItem aboutMenuItem1 = new javax.swing.JMenuItem();
statusPanel = new javax.swing.JPanel();
javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
statusMessageLabel = new javax.swing.JLabel();
statusAnimationLabel = new javax.swing.JLabel();
progressBar = new javax.swing.JProgressBar();
jDialog12 = new javax.swing.JDialog();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jDialog1 = new javax.swing.JDialog();
jPanel2 = new javax.swing.JPanel();
jScrollPane2 = new javax.swing.JScrollPane();
jEditorPane1 = new javax.swing.JEditorPane();
mainPanel.setName("mainPanel"); // NOI18N
mainPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(chemeq.ChemEqApp.class).getContext().getResourceMap(ChemEqView.class);
jPanel1.setBackground(resourceMap.getColor("jPanel1.background")); // NOI18N
jPanel1.setName("jPanel1"); // NOI18N
jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }));
jComboBox1.setVisible(false);
jComboBox1.setName("jComboBox1"); // NOI18N
jPanel1.add(jComboBox1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, 50, -1));
jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }));
jComboBox2.setName("jComboBox2"); // NOI18N
jComboBox2.setVisible(false);
jPanel1.add(jComboBox2, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, 30, 50, -1));
jComboBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }));
jComboBox3.setName("jComboBox3"); // NOI18N
jComboBox3.setVisible(false);
jPanel1.add(jComboBox3, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 30, 50, -1));
jComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }));
jComboBox4.setName("jComboBox4"); // NOI18N
jComboBox4.setVisible(false);
jPanel1.add(jComboBox4, new org.netbeans.lib.awtextra.AbsoluteConstraints(590, 30, 50, -1));
jComboBox5.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-------------", "NaCl", "KF", "CuCO3", "Zn", "AgNO3", "HCl", "H2SO4", "H3PO4" }));
jComboBox5.setName("jComboBox5"); // NOI18N
jComboBox5.setVisible(false);
jPanel1.add(jComboBox5, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 30, -1, -1));
jComboBox6.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-------------", "Ba(OH)2", "Al(OH)3", "CaBr2", "NaNO2", "Li2SO3" }));
jComboBox6.setName("jComboBox6"); // NOI18N
jComboBox6.setVisible(false);
jPanel1.add(jComboBox6, new org.netbeans.lib.awtextra.AbsoluteConstraints(260, 30, -1, -1));
jComboBox7.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-------------", "Al2(SO4)3", "Al2(CO3)3", "AlCl3", "AlF3", "Ag2SO3", "AgOH", "AgNO2", "AgBr", "BaCO3", "BaSO4", "BaCl2", "CuSO3", "CaSO4", "CaF2", "CaCO3", "KNO2", "KOH", "LiCl", "Li2SO4", "LiF", "NaCl", "NaBr", "Na2SO4", "NaNO2", "Zn(OH)2", "ZnBr2", "Zn(NO2)2", "ZnSO3" }));
jComboBox7.setName("jComboBox7"); // NOI18N
jComboBox7.setVisible(false);
jPanel1.add(jComboBox7, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 30, -1, -1));
jComboBox8.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-------------", "Al", "Al(NO3)3", "Ba", "BaF2", "Ba(NO3)2", "Ca", "CaCl2", "CaF2", "Ca(NO3)2", "Cu(NO2)2", "Cu(OH)2", "CuBr2", "H2SO3", "H2SO4", "HNO2", "H2O", "HBr", "Na", "NaNO3", "Na2SO3", "NaBr", "NaOH", "NaF", "Na2CO3", "KBr", "K2SO3", "KOH", "Li", "LiNO3", "Li2CO3" }));
jComboBox8.setName("jComboBox8"); // NOI18N
jComboBox8.setVisible(false);
jPanel1.add(jComboBox8, new org.netbeans.lib.awtextra.AbsoluteConstraints(640, 30, -1, -1));
jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
jLabel1.setForeground(resourceMap.getColor("jLabel1.foreground")); // NOI18N
jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
jLabel1.setVisible(false);
jLabel1.setName("jLabel1"); // NOI18N
jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(184, 35, -1, -1));
jLabel2.setForeground(resourceMap.getColor("jLabel2.foreground")); // NOI18N
jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
jLabel2.setName("jLabel2"); // NOI18N
jLabel2.setVisible(false);
jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(564, 35, -1, -1));
jLabel3.setForeground(resourceMap.getColor("jLabel3.foreground")); // NOI18N
jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
jLabel3.setFont(new java.awt.Font("", 5,18));
jLabel3.setName("jLabel3"); // NOI18N
jLabel3.setVisible(false);
jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 40, 20, -1));
jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
jButton1.setName("jButton1"); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jPanel1.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 90, 131, -1));
jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
jButton2.setName("jButton2"); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jPanel1.add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 130, 131, -1));
jButton3.setText(resourceMap.getString("jButton3.text")); // NOI18N
jButton3.setName("jButton3"); // NOI18N
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jPanel1.add(jButton3, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 130, 131, -1));
jButton4.setText(resourceMap.getString("jButton4.text")); // NOI18N
jButton4.setName("jButton4"); // NOI18N
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jPanel1.add(jButton4, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 130, 131, -1));
jButton5.setText(resourceMap.getString("jButton5.text")); // NOI18N
jButton5.setName("jButton5"); // NOI18N
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});
jPanel1.add(jButton5, new org.netbeans.lib.awtextra.AbsoluteConstraints(610, 90, 131, -1));
jButton6.setText(resourceMap.getString("jButton6.text")); // NOI18N
jButton6.setName("jButton6"); // NOI18N
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});
jPanel1.add(jButton6, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 90, 131, -1));
jLabel4.setFont(resourceMap.getFont("jLabel4.font")); // NOI18N
jLabel4.setForeground(resourceMap.getColor("jLabel4.foreground")); // NOI18N
jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
jLabel4.setName("jLabel4"); // NOI18N
jLabel4.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 90, 190, 60));
jLabel6.setIcon(resourceMap.getIcon("jLabel6.icon")); // NOI18N
jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
jLabel6.setName("jLabel6"); // NOI18N
jPanel1.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 70, 100, 90));
jLabel5.setIcon(resourceMap.getIcon("jLabel5.icon")); // NOI18N
jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
jLabel5.setName("jLabel5"); // NOI18N
jPanel1.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 780, 220));
mainPanel.add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(12, 0, 780, -1));
menuBar1.setName("menuBar1"); // NOI18N
menuBar1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
fileMenu.setName("fileMenu"); // NOI18N
javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(chemeq.ChemEqApp.class).getContext().getActionMap(ChemEqView.class, this);
exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
exitMenuItem.setText(resourceMap.getString("exitMenuItem.text")); // NOI18N
exitMenuItem.setName("exitMenuItem"); // NOI18N
fileMenu.add(exitMenuItem);
menuBar1.add(fileMenu);
helpMenu1.setText(resourceMap.getString("helpMenu1.text")); // NOI18N
helpMenu1.setActionCommand(resourceMap.getString("helpMenu1.actionCommand")); // NOI18N
helpMenu1.setName("helpMenu1"); // NOI18N
aboutMenuItem1.setAction(actionMap.get("showAboutBox")); // NOI18N
aboutMenuItem1.setText(resourceMap.getString("aboutMenuItem1.text")); // NOI18N
aboutMenuItem1.setName("aboutMenuItem1"); // NOI18N
aboutMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
aboutMenuItem1ActionPerformed(evt);
}
});
helpMenu1.add(aboutMenuItem1);
menuBar1.add(helpMenu1);
statusPanel.setName("statusPanel"); // NOI18N
statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N
statusMessageLabel.setName("statusMessageLabel"); // NOI18N
statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N
progressBar.setName("progressBar"); // NOI18N
javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
statusPanel.setLayout(statusPanelLayout);
statusPanelLayout.setHorizontalGroup(
statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 810, Short.MAX_VALUE)
.addGroup(statusPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(statusMessageLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 624, Short.MAX_VALUE)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(statusAnimationLabel)
.addContainerGap())
);
statusPanelLayout.setVerticalGroup(
statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(statusPanelLayout.createSequentialGroup()
.addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(statusMessageLabel)
.addComponent(statusAnimationLabel)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(3, 3, 3))
);
jDialog12.setTitle(resourceMap.getString("jDialog12.title")); // NOI18N
jDialog12.setName("jDialog12"); // NOI18N
jDialog12.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
jScrollPane1.setName("jScrollPane1"); // NOI18N
jTextArea1.setColumns(20);
jTextArea1.setEditable(false);
jTextArea1.setRows(5);
jTextArea1.setText(resourceMap.getString("jTextArea1.text")); // NOI18N
jTextArea1.setName("jTextArea1"); // NOI18N
jScrollPane1.setViewportView(jTextArea1);
javax.swing.GroupLayout jDialog12Layout = new javax.swing.GroupLayout(jDialog12.getContentPane());
jDialog12.getContentPane().setLayout(jDialog12Layout);
jDialog12Layout.setHorizontalGroup(
jDialog12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
);
jDialog12Layout.setVerticalGroup(
jDialog12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)
);
jDialog1.setMinimumSize(new java.awt.Dimension(800, 600));
jDialog1.setName("jDialog1"); // NOI18N
jPanel2.setName("jPanel2"); // NOI18N
jScrollPane2.setName("jScrollPane2"); // NOI18N
jEditorPane1.setName("jEditorPane1"); // NOI18N
jEditorPane1.setEditable(false);
try{
jEditorPane1 = new javax.swing.JEditorPane(getClass().getResource("/html/aa.html"));
}catch(Exception ex){}
jEditorPane1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
jEditorPane1.setFont(new java.awt.Font("Tahoma", 1, 18));
jScrollPane2.setViewportView(jEditorPane1);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 687, Short.MAX_VALUE)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
);
javax.swing.GroupLayout jDialog1Layout = new javax.swing.GroupLayout(jDialog1.getContentPane());
jDialog1.getContentPane().setLayout(jDialog1Layout);
jDialog1Layout.setHorizontalGroup(
jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDialog1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
jDialog1Layout.setVerticalGroup(
jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDialog1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
setComponent(mainPanel);
setMenuBar(menuBar1);
setStatusBar(statusPanel);
}//
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("NaCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("BaCl2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("NaOH")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
// jDialog1.
// User has typed in a string; only possible with an editable combobox
//janeshini Doganeh
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("KF") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("KOH") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("BaF2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
// User has selected an item; it may be the same item
} else if (jComboBox1.getSelectedItem().equals("3") && jComboBox5.getSelectedItem().equals("NaCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("AlCl3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("NaOH")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("NaCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("NaBr") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("CaCl2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("0") && jComboBox5.getSelectedItem().equals("NaCl") && jComboBox2.getSelectedItem().equals("0") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("0") && jComboBox7.getSelectedItem().equals("-------------") && jComboBox4.getSelectedItem().equals("0") && jComboBox8.getSelectedItem().equals("-------------")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("NaCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("LiCl") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Na2SO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("KF") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("KOH") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("BaF2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("3") && jComboBox5.getSelectedItem().equals("KF") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("AlF3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("KOH")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("KF") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("CaF2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("KBr")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("KF") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("KNO2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("NaF")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("KF") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("LiF") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("K2SO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("CuCO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("BaCO3") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Cu(OH)2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("3") && jComboBox5.getSelectedItem().equals("CuCO3") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Al2(CO3)3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("Cu(OH)2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("CuCO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("CaCO3") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("CuBr2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("CuCO3") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Na2CO3") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Cu(NO2)2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("CuCO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("CuSO3") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Li2CO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("AgNO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("AgOH") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Ba(NO3)2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("3") && jComboBox5.getSelectedItem().equals("AgNO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("3") && jComboBox7.getSelectedItem().equals("AgOH") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Al(NO3)3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("AgNO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("AgBr") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Ca(NO3)2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("AgNO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("AgNO2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("NaNO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("AgNO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Ag2SO3") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("LiNO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("HCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("BaCl2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("3") && jComboBox5.getSelectedItem().equals("HCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("AlCl3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("HCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("CaCl2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("HBr")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("HCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("NaCl") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("HNO2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("HCl") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("LiCl") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("H2SO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
//H2SO4
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("H2SO4") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("BaSO4") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("3") && jComboBox5.getSelectedItem().equals("H2SO4") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Al(SO4)3") && jComboBox4.getSelectedItem().equals("6") && jComboBox8.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("H2SO4") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("CaSO4") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("HBr")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("H2SO4") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Na2SO4") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("HNO2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("H2SO4") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Li2SO4") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2SO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
//H3PO4
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("H3PO4") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Ba3(PO4)2") && jComboBox4.getSelectedItem().equals("6") && jComboBox8.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("H3PO4") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("AlPO4") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("H3PO4") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Ca3(PO4)2") && jComboBox4.getSelectedItem().equals("6") && jComboBox8.getSelectedItem().equals("HBr")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("H3PO4") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Na3PO4") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("HNO2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("H3PO4") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Li3PO4") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("H2SO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
//Zn
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Ba(OH)2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Zn(OH)2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Ba")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("3") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("3") && jComboBox7.getSelectedItem().equals("Zn(OH)2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("Al")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaBr2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("ZnBr2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Ca")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("NaNO2") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Zn(NO2)2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("Na")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Li2SO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("ZnSO3") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("Li")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
//End Zn
//End Janeshini Doganeh
//Start Janeshini sadeh
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CuSO4") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("ZnSO4") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Cu")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Al") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("CuSO4") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Al2(SO4)3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("Cu")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Na") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("NaOH") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Ca") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Ca(OH)2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Fe") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("HCl") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("FeCl2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Al") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("CuSO4") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Al2(SO4)3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("Cu")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("ZnO") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Al") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Al2O3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("F2") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("NaI") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("NaF") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("I2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Ca") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("HCl") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("CaCl2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Na") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("HCl") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("NaCl") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Al") && jComboBox2.getSelectedItem().equals("6") && jComboBox6.getSelectedItem().equals("HCl") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("AlCl3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Al") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("AgNO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Al(NO3)3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("Ag")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Al") && jComboBox2.getSelectedItem().equals("3") && jComboBox6.getSelectedItem().equals("NaI") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("AlI3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("Na")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("NaI") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("ZnI2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("Na")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("HCl") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("ZnCl2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("H2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Zn") && jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("AgNO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Zn(NO3)2") && jComboBox4.getSelectedItem().equals("2") && jComboBox8.getSelectedItem().equals("Ag")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
//End Janeshini sadeh
//Start tajzieh
} else if (jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("CaCO3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("CaO") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("CO2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("H2") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("O2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("HgO") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("Hg") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("O2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("NaCl") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("Na") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("Cl2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("H2SO4") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("H2O") && jComboBox4.getSelectedItem().equals("1") && jComboBox8.getSelectedItem().equals("SO3")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox2.getSelectedItem().equals("2") && jComboBox6.getSelectedItem().equals("Al(OH)3") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Al2O3") && jComboBox4.getSelectedItem().equals("3") && jComboBox8.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
//End Tajzieh
//Start Tarkib
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("H2") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("O2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("H2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("Na2O") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("NaOH")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("CaO") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("Ca(OH)2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("SO3") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("H2O") && jComboBox3.getSelectedItem().equals("1") && jComboBox7.getSelectedItem().equals("H2SO4")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Na2O") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("O2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("Na2O2")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Cu") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("O2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("CuO")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("4") && jComboBox5.getSelectedItem().equals("Cu") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("O2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("Cu2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("4") && jComboBox5.getSelectedItem().equals("Na") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("O2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("Na2O")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("2") && jComboBox5.getSelectedItem().equals("Na") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Cl2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("NaCl")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
} else if (jComboBox1.getSelectedItem().equals("1") && jComboBox5.getSelectedItem().equals("H2") && jComboBox2.getSelectedItem().equals("1") && jComboBox6.getSelectedItem().equals("Cl2") && jComboBox3.getSelectedItem().equals("2") && jComboBox7.getSelectedItem().equals("HCl")) {
JOptionPane.showMessageDialog(null, "درسته! برو بعدی", "آفرین", 1);
//End Tarkib
} else if (jComboBox1.getSelectedItem().equals("0") && jComboBox5.getSelectedItem().equals("-------------") && jComboBox2.getSelectedItem().equals("0") && jComboBox6.getSelectedItem().equals("-------------") && jComboBox3.getSelectedItem().equals("0") && jComboBox7.getSelectedItem().equals("-------------") && jComboBox4.getSelectedItem().equals("0") && jComboBox8.getSelectedItem().equals("-------------")) {
//JOptionPane.showMessageDialog(null, "ابتدا از دو منو دوم و چهارم از سمت چپ دو ماده انتخاب کنید ،\nسپس بر اساس دو انتخاب اول از منو ششم و هشتم گزینه های \n درست را پیدا کنید و پس از آن از منو های اعداد ضرایب صحیح را\n انتخاب کرده بر روی دکمه (برسی درستی) کلیک کنید تا نتیجه را\n مشاهده کنید.\nهمان طور که می دانید در واکنش های جانشینی دوگانه زمانی یک\nواکنش انجام شدنی است که یکی از فراورده ها آب، گاز یا رسوب\nباشد. که این مسئله در این نرم افزار در نظر گرفته نشده است.\n\nلطفآ هر گونه اشکال یا پیشنهاد را به آدرس پستی زیر ارسال\nنمایید.\nکیان کیانی\nkian34@gmail.com\n۰۹۱۳۱۰۰۵۱۵۴", "راهنما", 1);
// jDialog12.setVisible(true);
this.showAboutBox();
} else {
JOptionPane.showMessageDialog(null, "اشتباه! دوباره سعی کن", "نه", 1);
}// TODO add your handling code here:
}//GEN-LAST:event_jButton1ActionPerformed
private void aboutMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutMenuItem1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_aboutMenuItem1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
jDialog1.setVisible(true); // TODO add your handling code here:
}//GEN-LAST:event_jButton2ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
//Janeshini doganeh
jComboBox1.setVisible(true);
jComboBox5.setVisible(true);
jLabel1.setVisible(true);
jComboBox2.setVisible(true);
jComboBox6.setVisible(true);
jLabel3.setVisible(true);
jComboBox3.setVisible(true);
jComboBox7.setVisible(true);
jLabel2.setVisible(true);
jComboBox4.setVisible(true);
jComboBox8.setVisible(true);
jLabel4.setText("واکنش جانشینی دوگانه");
jComboBox5.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "NaCl", "KF", "CuCO3", "AgNO3", "HCl", "H2SO4", "H3PO4"}));
jComboBox6.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Ba(OH)2", "Al(OH)3", "CaBr2", "NaNO2", "Li2SO3"}));
jComboBox7.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Al2(SO4)3", "Al2(CO3)3", "AlCl3", "AlF3", "Ag2SO3", "AgOH", "AgNO2", "AgBr", "BaCO3", "BaSO4", "BaCl2", "CuSO3", "CaSO4", "CaF2", "CaCO3", "KNO2", "KOH", "LiCl", "Li2SO4", "LiF", "NaCl", "NaBr", "Na2SO4", "NaNO2", "Zn(OH)2", "ZnBr2", "Zn(NO2)2", "ZnSO3"}));
jComboBox8.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Al(NO3)3", "BaF2", "Ba(NO3)2", "CaCl2", "CaF2", "Ca(NO3)2", "Cu(NO2)2", "Cu(OH)2", "CuBr2", "H2SO3", "H2SO4", "HNO2", "H2O", "HBr", "NaNO3", "Na2SO3", "NaBr", "NaOH", "NaF", "Na2CO3", "KBr", "K2SO3", "KOH", "LiNO3", "Li2CO3"}));
// TODO add your handling code here:
}//GEN-LAST:event_jButton3ActionPerformed
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
//Tajzieh
jComboBox1.setVisible(false);
jComboBox5.setVisible(false);
jLabel1.setVisible(false);
jComboBox2.setVisible(true);
jComboBox6.setVisible(true);
jLabel3.setVisible(true);
jComboBox3.setVisible(true);
jComboBox7.setVisible(true);
jLabel2.setVisible(true);
jComboBox4.setVisible(true);
jComboBox8.setVisible(true);
jLabel4.setText("واکنش تجزیه");
jComboBox6.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "CaCO3", "H2O", "HgO", "NaCl", "H2SO4", "Al(OH)3"}));
jComboBox7.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Na", "H2", "H2O", "Hg", "Al2O3", "CaO"}));
jComboBox8.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Cl2", "SO3", "H2O", "O2", "CO2"}));
// TODO add your handling code here:
}//GEN-LAST:event_jButton4ActionPerformed
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
//Tarkib
jComboBox1.setVisible(true);
jComboBox5.setVisible(true);
jLabel1.setVisible(true);
jComboBox2.setVisible(true);
jComboBox6.setVisible(true);
jLabel3.setVisible(true);
jComboBox3.setVisible(true);
jComboBox7.setVisible(true);
jLabel2.setVisible(false);
jComboBox4.setVisible(false);
jComboBox8.setVisible(false);
jLabel4.setText("واکنش ترکیب");
jComboBox5.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "H2", "Na2O", "CaO", "SO3", "Cu", "Na"}));
jComboBox6.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "O2", "H2O", "Cl2"}));
jComboBox7.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "NaCl", "Na2O", "HCl", "H2O", "Ca(OH)2", "NaOH", "H2SO4", "Na2O2", "CuO", "Cu2O"}));
// TODO add your handling code here:
}//GEN-LAST:event_jButton5ActionPerformed
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
//janeshini sadeh
jComboBox1.setVisible(true);
jComboBox5.setVisible(true);
jLabel1.setVisible(true);
jComboBox2.setVisible(true);
jComboBox6.setVisible(true);
jLabel3.setVisible(true);
jComboBox3.setVisible(true);
jComboBox7.setVisible(true);
jLabel2.setVisible(true);
jComboBox4.setVisible(true);
jComboBox8.setVisible(true);
jLabel4.setText("واکنش جانشینی ساده");
jComboBox5.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Zn", "Al", "Na", "Ca", "Fe", "F2"}));
jComboBox6.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "CuSO4", "AgNO3", "H2O", "HCl", "NaI"}));
jComboBox7.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Al(NO3)3", "Al2(SO4)3", "Al2O3", "AlCl3", "AlI3", "Ca(OH)2", "CaSO4", "CaCl2", "FeCl2", "NaOH", "NaF", "NaCl","ZnO", "ZnSO4", "ZnCl2" , "ZnI2", "Zn(NO3)2" }));
jComboBox8.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"-------------", "Cu", "Ag", "H2", "I2"}));
// TODO add your handling code here:
}//GEN-LAST:event_jButton6ActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JComboBox jComboBox1;
private javax.swing.JComboBox jComboBox2;
private javax.swing.JComboBox jComboBox3;
private javax.swing.JComboBox jComboBox4;
private javax.swing.JComboBox jComboBox5;
private javax.swing.JComboBox jComboBox6;
private javax.swing.JComboBox jComboBox7;
private javax.swing.JComboBox jComboBox8;
private javax.swing.JDialog jDialog1;
private javax.swing.JDialog jDialog12;
private javax.swing.JEditorPane jEditorPane1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JPanel mainPanel;
private javax.swing.JMenuBar menuBar1;
private javax.swing.JProgressBar progressBar;
private javax.swing.JLabel statusAnimationLabel;
private javax.swing.JLabel statusMessageLabel;
private javax.swing.JPanel statusPanel;
// End of variables declaration//GEN-END:variables
private final Timer messageTimer;
private final Timer busyIconTimer;
private final Icon idleIcon;
private final Icon[] busyIcons = new Icon[15];
private int busyIconIndex = 0;
private JDialog aboutBox;
}
هیچ نظری موجود نیست:
ارسال یک نظر