Java
Java
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to
change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this
template
*/
package com.mycompany.proiectjava;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
/**
*
* @author Nitro
*/
public class InterfataMotoTermica extends javax.swing.JFrame {
/**
* 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")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("MASINI TERMICE");
jLabel1.setFont(new java.awt.Font("Tahoma", 3, 14)); // NOI18N
jLabel1.setText("CARACTERISTICI MASINI TERMICE");
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 530, Short.MAX_VALUE)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 133, Short.MAX_VALUE)
);
pack();
}// </editor-fold>
if ("Motor".equals(selectedValue) && !
isFrameOpen(InterfataMotor.class)) {
new InterfataMotor().setVisible(true);
}
}
});
}
String tipMotor=jTextField1.getText();
String model=jTextField2.getText();
// jPanel1.add(label1);
// jPanel1.add(textField1);
// jPanel1.add(label2);
// jPanel1.add(textField2);
afiseazaInformatii(tipMotor, model);
}
private void afisareMasina(String tipMotor, String model) {
setTitle("Afisare Moto Termica");
setSize(400, 300);
afiseazaInformatii(tipMotor, model);
JScrollPane scrollPane=new JScrollPane(panel);
getContentPane().add(scrollPane);
setVisible(true);
}
private void afiseazaInformatii(String tipMotor, String model){
}
}
panel.setVisible(true);
}
}
return false;}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the
default look and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(InterfataMasiniTermice.class.getName()).log(java
.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(InterfataMasiniTermice.class.getName()).log(java
.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(InterfataMasiniTermice.class.getName()).log(java
.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(InterfataMasiniTermice.class.getName()).log(java
.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new InterfataMotoTermica().setVisible(true);
}
});
}