public class ProjetoSOView extends FrameView {
static void adicionarLinha2() {
throw new UnsupportedOperationException("Not yet implemented");
}
/**
* Essas duas variaveis vai auxiliar o retorno de dados
* do cadastro do processo filho.
*/
public String nomeFilho;
public String prioridadeFilho;
public int pidTemporario =100;
public int pidAux =100;
public String statusTemp = "Wait" ;
public boolean temFilho = false;
public static int indicePai = 1;
Processo objprocesso = new Processo();
public static int indiceFilho = 0;
/**
* Variaveis Originais
*/
/**
* A variavel num e usada para o ComboBox da Tela Principal
* Usada na as prioridades do processo
*/
int[] num = {0,1,2};
/**
* PID do Processo
* Identidade do processo
*/
public static int[][] pid;
/**
* Nome do Processo
*/
public static String[][] nome;
/**
* Status do Processo
* Existe 3 status do processo: esperando, processado, processado
*/
public static String[][] status;
/**
* Prioridade do Processo
* Existe uma escala para se definir a prioridade
* a escala está dentre 0 à 9.
*/
public static String[][] prioridade;
/**
* Metódo Principal
*/
public ProjetoSOView(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);
}
}
});
}
public void ProjetoSOView() {
throw new UnsupportedOperationException("Not yet implemented");
}
@Action
public void showAboutBox() {
if (aboutBox == null) {
JFrame mainFrame = ProjetoSOApp.getApplication().getMainFrame();
aboutBox = new ProjetoSOAboutBox(mainFrame);
aboutBox.setLocationRelativeTo(mainFrame);
}
ProjetoSOApp.getApplication().show(aboutBox);
}
public void listComboBox(){
int[] num = {0,1,2};
}
public void adicionarLinha(int aux, String aux2, String aux3, String aux4){
DefaultTableModel modelo = (DefaultTableModel)Tabela.getModel();
String aux1;
aux1 = String.valueOf(aux); //Cast para converter de double para String
modelo.addRow(new String [] {aux1,aux2, aux3, aux4});
}
private void adicionarLinha(String string, String string0, String statusTemp, String prioridadeComboBox) {
throw new UnsupportedOperationException("Not yet implemented");
}
public void adicionarLinha2(int aux, int aux2, String aux3, String aux4){
DefaultTableModel modelo = (DefaultTableModel)Tabela2.getModel();
String aux1, aux22;
aux1 = String.valueOf(aux); //Cast para converter de double para String
aux22 = String.valueOf(aux2);
modelo.addRow(new String [] {aux1,aux22, aux3, aux4});
}
private void adicionarLinha2(int i, String string, String statusTemp, int i0) {
throw new UnsupportedOperationException("Not yet implemented");
}
/** 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.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
mainPanel = new javax.swing.JPanel();
jCheckBox1 = new javax.swing.JCheckBox();
jScrollPane1 = new javax.swing.JScrollPane();
Tabela = new javax.swing.JTable();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
jComboBox1 = new javax.swing.JComboBox();
CriarButton = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jSeparator1 = new javax.swing.JSeparator();
novoProcessoButton = new javax.swing.JButton();
jLabel8 = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane();
Tabela2 = new javax.swing.JTable();
jLabel9 = new javax.swing.JLabel();
atualizaButton = new javax.swing.JButton();
menuBar = new javax.swing.JMenuBar();
javax.swing.JMenu fileMenu = new javax.swing.JMenu();
javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
javax.swing.JMenu helpMenu = new javax.swing.JMenu();
javax.swing.JMenuItem aboutMenuItem = 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();
jDialog1 = new javax.swing.JDialog();
jTextField1 = new javax.swing.JTextField();
closeButton = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jComboBox2 = new javax.swing.JComboBox();
jButton1 = new javax.swing.JButton();
criarFilhoButton = new javax.swing.JButton();
Erro = new javax.swing.JDialog();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
okErroButton = new javax.swing.JButton();
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(projetoso.ProjetoSOApp.class).getContext().getResourceMap(ProjetoSOView.class);
mainPanel.setToolTipText(resourceMap.getString("mainPanel.toolTipText")); // NOI18N
mainPanel.setMaximumSize(new java.awt.Dimension(45000, 45000));
mainPanel.setName("mainPanel"); // NOI18N
jCheckBox1.setText(resourceMap.getString("jCheckBox1.text")); // NOI18N
jCheckBox1.setName("jCheckBox1"); // NOI18N
jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox1ActionPerformed(evt);
}
});
jScrollPane1.setName("jScrollPane1"); // NOI18N
Tabela.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"PID", "NOME", "STATUS", "PRIORIDADE"
}
));
Tabela.setName("Tabela"); // NOI18N
jScrollPane1.setViewportView(Tabela);
jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
jLabel1.setName("jLabel1"); // NOI18N
jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
jLabel2.setName("jLabel2"); // NOI18N
jTextField3.setText(resourceMap.getString("jTextField3.text")); // NOI18N
jTextField3.setText("");
jTextField3.setName("jTextField3"); // NOI18N
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] {"0", "1", "2" }));
jComboBox1.setName("jComboBox1"); // NOI18N
CriarButton.setText(resourceMap.getString("CriarButton.text")); // NOI18N
CriarButton.setName("CriarButton"); // NOI18N
CriarButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CriarButtonActionPerformed(evt);
}
});
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);
}
});
jSeparator1.setName("jSeparator1"); // NOI18N
novoProcessoButton.setText(resourceMap.getString("novoProcessoButton.text")); // NOI18N
novoProcessoButton.setName("novoProcessoButton"); // NOI18N
novoProcessoButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
novoProcessoButtonActionPerformed(evt);
}
});
jLabel8.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
jLabel8.setName("jLabel8"); // NOI18N
jScrollPane2.setName("jScrollPane2"); // NOI18N
Tabela2.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"PID", "NOME", "STATUS", "PRIORIDADE"
}
));
Tabela2.setName("Tabela2"); // NOI18N
jScrollPane2.setViewportView(Tabela2);
jLabel9.setFont(resourceMap.getFont("jLabel9.font")); // NOI18N
jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
jLabel9.setName("jLabel9"); // NOI18N
atualizaButton.setText(resourceMap.getString("atualizaButton.text")); // NOI18N
atualizaButton.setName("atualizaButton"); // NOI18N
atualizaButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
atualizaButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 361, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addGap(6, 6, 6)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addGap(48, 48, 48)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(mainPanelLayout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jCheckBox1)))
.addGroup(mainPanelLayout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(novoProcessoButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(CriarButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2))
.addGroup(mainPanelLayout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 328, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
.addGroup(mainPanelLayout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel9)))
.addGroup(mainPanelLayout.createSequentialGroup()
.addGap(130, 130, 130)
.addComponent(atualizaButton))))
.addComponent(jLabel8))
.addContainerGap())
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
.addContainerGap(383, Short.MAX_VALUE)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 322, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
.addGap(34, 34, 34)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jCheckBox1)
.addGap(18, 18, 18)
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(CriarButton)
.addComponent(novoProcessoButton)
.addComponent(jButton2))
.addGap(18, 18, 18)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel9)
.addGap(19, 19, 19)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(atualizaButton))
.addGroup(mainPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 472, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(76, Short.MAX_VALUE))
);
menuBar.setName("menuBar"); // NOI18N
fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
fileMenu.setName("fileMenu"); // NOI18N
javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(projetoso.ProjetoSOApp.class).getContext().getActionMap(ProjetoSOView.class, this);
exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
exitMenuItem.setName("exitMenuItem"); // NOI18N
fileMenu.add(exitMenuItem);
menuBar.add(fileMenu);
helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
helpMenu.setName("helpMenu"); // NOI18N
aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
aboutMenuItem.setName("aboutMenuItem"); // NOI18N
helpMenu.add(aboutMenuItem);
menuBar.add(helpMenu);
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, 715, Short.MAX_VALUE)
.addGroup(statusPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(statusMessageLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 545, 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))
);
jDialog1.setTitle(resourceMap.getString("jDialog1.title")); // NOI18N
jDialog1.setBounds(new java.awt.Rectangle(0, 0, 0, 0));
jDialog1.setMinimumSize(new java.awt.Dimension(320, 220));
jDialog1.setModal(true);
jDialog1.setName("jDialog1"); // NOI18N
jTextField1.setText(resourceMap.getString("jTextField1.text")); // NOI18N
jTextField1.setName("jTextField1"); // NOI18N
closeButton.setText(resourceMap.getString("closeButton.text")); // NOI18N
closeButton.setName("closeButton"); // NOI18N
closeButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
closeButtonActionPerformed(evt);
}
});
jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
jLabel3.setName("jLabel3"); // NOI18N
jLabel4.setFont(resourceMap.getFont("jLabel4.font")); // NOI18N
jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
jLabel4.setName("jLabel4"); // NOI18N
jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
jLabel5.setName("jLabel5"); // NOI18N
jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2" }));
jComboBox2.setName("jComboBox2"); // NOI18N
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);
}
});
criarFilhoButton.setText(resourceMap.getString("criarFilhoButton.text")); // NOI18N
criarFilhoButton.setName("criarFilhoButton"); // NOI18N
criarFilhoButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
criarFilhoButtonActionPerformed(evt);
}
});
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()
.addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDialog1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel4))
.addGroup(jDialog1Layout.createSequentialGroup()
.addGap(33, 33, 33)
.addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDialog1Layout.createSequentialGroup()
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jDialog1Layout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jDialog1Layout.createSequentialGroup()
.addGap(3, 3, 3)
.addComponent(criarFilhoButton)
.addGap(18, 18, 18)
.addComponent(jButton1)
.addGap(18, 18, 18)
.addComponent(closeButton)))))
.addContainerGap(32, Short.MAX_VALUE))
);
jDialog1Layout.setVerticalGroup(
jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDialog1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel4)
.addGap(23, 23, 23)
.addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(27, 27, 27)
.addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(closeButton)
.addComponent(jButton1)
.addComponent(criarFilhoButton))
.addContainerGap(21, Short.MAX_VALUE))
);
Erro.setTitle(resourceMap.getString("Erro.title")); // NOI18N
Erro.setMinimumSize(new java.awt.Dimension(400, 250));
Erro.setModal(true);
Erro.setName("Erro"); // NOI18N
jLabel6.setFont(resourceMap.getFont("jLabel6.font")); // NOI18N
jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
jLabel6.setName("jLabel6"); // NOI18N
jLabel7.setFont(resourceMap.getFont("jLabel7.font")); // NOI18N
jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
jLabel7.setName("jLabel7"); // NOI18N
okErroButton.setText(resourceMap.getString("okErroButton.text")); // NOI18N
okErroButton.setName("okErroButton"); // NOI18N
okErroButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
okErroButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout ErroLayout = new javax.swing.GroupLayout(Erro.getContentPane());
Erro.getContentPane().setLayout(ErroLayout);
ErroLayout.setHorizontalGroup(
ErroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(ErroLayout.createSequentialGroup()
.addContainerGap()
.addGroup(ErroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel6)
.addComponent(jLabel7))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, ErroLayout.createSequentialGroup()
.addContainerGap(285, Short.MAX_VALUE)
.addComponent(okErroButton)
.addGap(54, 54, 54))
);
ErroLayout.setVerticalGroup(
ErroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(ErroLayout.createSequentialGroup()
.addGap(26, 26, 26)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(okErroButton)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
setComponent(mainPanel);
setMenuBar(menuBar);
setStatusBar(statusPanel);
}// </editor-fold>
/**
* Esse metodo server para fazer a chamanda da jDialog para entrada
* dos Filhos do processo.
* @param evt
*/
@SuppressWarnings("static-access")
private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {
String temp = jTextField3.getText();
if (temp.equals("")){
Erro.setVisible(true);
jDialog1.setVisible(false);
}else{
if (jCheckBox1.isSelected()){
pidTemporario = pidAux;
String prioridadeComboBox = jComboBox1.getSelectedItem().toString();
String nomeRetorno = jTextField3.getText();
adicionarLinha(pidTemporario, nomeRetorno,statusTemp,prioridadeComboBox);
jDialog1.setVisible(true);
}
}
}
/**
* Esse metodo e para fechar a janela do jDialog1 e desmarcar
* o checkbox da tela principal.
* @param evt
*/
private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {
jDialog1.setVisible(false);
jCheckBox1.setSelected(false);
temFilho = false;
}
/**
* Esse metodo para limpar e cancelar.
* @param evt
*/
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
jTextField3.setText("");
jComboBox1.setSelectedItem("0");
jCheckBox1.setSelected(false);
// TODO add your handling code here:
}
@SuppressWarnings("static-access")
private void CriarButtonActionPerformed(java.awt.event.ActionEvent evt) {
if (temFilho == false){
pidTemporario = pidAux;
String prioridadeComboBox = jComboBox1.getSelectedItem().toString();
String nomeRetorno = jTextField3.getText();
adicionarLinha(pidTemporario, nomeRetorno,statusTemp,prioridadeComboBox);
System.out.println("Aqui "+"Pai:"+indicePai+" Filho:"+indiceFilho);
ProjetoSOView.pid[indicePai][indiceFilho] = pidAux;
this.nome[indicePai][indiceFilho] = nomeRetorno;
this.status[indicePai][indiceFilho] = statusTemp;
this.prioridade[indicePai][indiceFilho] = prioridadeComboBox;
}
}
/**
* Esse metodo para limpar e cancelar o cadastro do processo filho
* @param evt
*/
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
jTextField1.setText("");
jComboBox2.setSelectedItem("0");
}
@SuppressWarnings("static-access")
private void criarFilhoButtonActionPerformed(java.awt.event.ActionEvent evt) {
nomeFilho = jTextField1.getText();
prioridadeFilho = jComboBox2.getSelectedItem().toString();
pidTemporario = pidTemporario + 1;
indiceFilho = indiceFilho +1;
adicionarLinha(pidTemporario, nomeFilho,statusTemp,prioridadeFilho);
temFilho = true;
System.out.println("Aqui "+"Pai:"+indicePai+" Filho:"+indiceFilho);
this.pid[indicePai][indiceFilho] = pidTemporario;
this.nome[indicePai][indiceFilho] = nomeFilho;
this.status[indicePai][indiceFilho] = statusTemp;
this.prioridade[indicePai][indiceFilho] = prioridadeFilho;
}
private void okErroButtonActionPerformed(java.awt.event.ActionEvent evt) {
Erro.setVisible(false);
jCheckBox1.setSelected(false);
}
private void novoProcessoButtonActionPerformed(java.awt.event.ActionEvent evt) {
pidAux = pidAux + 100;
indicePai = indicePai + 1;
indiceFilho = 0;
jTextField3.setText("");
jComboBox1.setSelectedItem("0");
}
}
Erro que ta dando:
Exception occurred during event dispatching:
java.lang.NullPointerException
at projetoso.ProjetoSOView.criarFilhoButtonActionPerformed(ProjetoSOView.java:707)
at projetoso.ProjetoSOView.access$1500(ProjetoSOView.java:33)
at projetoso.ProjetoSOView$11.actionPerformed(ProjetoSOView.java:519)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:177)
at java.awt.Dialog$1.run(Dialog.java:1039)
at java.awt.Dialog$3.run(Dialog.java:1091)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Dialog.java:1089)
at java.awt.Component.show(Component.java:1419)
at java.awt.Component.setVisible(Component.java:1372)
at java.awt.Window.setVisible(Window.java:801)
at java.awt.Dialog.setVisible(Dialog.java:979)
at projetoso.ProjetoSOView.jCheckBox1ActionPerformed(ProjetoSOView.java:645)
at projetoso.ProjetoSOView.access$800(ProjetoSOView.java:33)
at projetoso.ProjetoSOView$4.actionPerformed(ProjetoSOView.java:247)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:291)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Aqui Pai:1 Filho:1
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at projetoso.ProjetoSOView.CriarButtonActionPerformed(ProjetoSOView.java:681)
at projetoso.ProjetoSOView.access$900(ProjetoSOView.java:33)
at projetoso.ProjetoSOView$5.actionPerformed(ProjetoSOView.java:281)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
BUILD SUCCESSFUL (total time: 21 seconds)
Não conseguir tirar o erro, eu procurei sobre esse erro e descobrir que é
significa q vc está apontando para um objeto que não existe, ou o caminho está incorreto....
Agora acho que estou fazendo certo, alguém poderia me ajudar? [code]
Ps.: Coloquei o projeto todo pq eu não sei aonde está o erro.