public void carregarDados() throws Exception { ResultSet especs = nucleo.getSpecific(espec); while (especs.next()) { jLabel2.setText(especs.getString(2)); txtcod.setText(especs.getString(1)); txtname.setText(especs.getString(2)); ResultSet ar = nucleo.getArea(especs.getString(3)); while (ar.next()) txtarea.setText(ar.getString(2)); ar.close(); } especs.close(); actualizarComboArea(); }
private void actualizarComboArea() throws Exception { ResultSet area = nucleo.listarArea(); while (area.next()) { if (area.getString(3) == null) comboarea.addItem(area.getString(2)); } area.close(); }
public String verTema(String nome) throws Exception { String res = ""; ResultSet temas = nucleo.listarArea(); while (temas.next() && res.equals("")) { if (temas.getString(2).equals(nome)) res = temas.getString(1); } temas.close(); return res; }
public media(String title) throws Exception { super(title); ResultSet dt = nucleo.getMedia(); CategoryDataset dataset = media.createDataset(dt); JFreeChart chart = media.createBarChart(dataset); ChartPanel panel = new ChartPanel(chart); panel.setPreferredSize(new Dimension(400, 300)); setContentPane(panel); dt.close(); }
public media(Nucleo nuc) throws Exception { super("Classificações"); initComponents(); nucleo = nuc; ResultSet dt = nucleo.getMedia(); CategoryDataset dataset = media.createDataset(dt); JFreeChart chart = media.createBarChart(dataset); ChartPanel panel = new ChartPanel(chart); panel.setPreferredSize(new Dimension(400, 300)); setContentPane(panel); }
private void jButton5MouseClicked( java.awt.event.MouseEvent evt) { // GEN-FIRST:event_jButton5MouseClicked if (jButton5.getText().equals("Guardar")) try { update(); JOptionPane.showMessageDialog(null, "Tipo Especifico alterado com sucesso!"); nucleo.setEnab(true); this.dispose(); } catch (Exception ex) { Logger.getLogger(frameEspecifico.class.getName()).log(Level.SEVERE, null, ex); } else try { gravar(); JOptionPane.showMessageDialog(null, "Tipo Especifico criado com sucesso!"); nucleo.setEnab(true); this.dispose(); } catch (Exception ex) { Logger.getLogger(frameEspecifico.class.getName()).log(Level.SEVERE, null, ex); } } // GEN-LAST:event_jButton5MouseClicked
private void jButton7ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButton7ActionPerformed GregorianCalendar dateA = new GregorianCalendar(); String data = dateA.get(Calendar.YEAR) + "." + dateA.get(Calendar.MONTH) + 1 + "." + dateA.get(Calendar.DAY_OF_MONTH); try { nucleo.apagarEspec(txtcod.getText(), data); // TODO add your handling code here: } catch (Exception ex) { JOptionPane.showMessageDialog(null, ex); return; } JOptionPane.showMessageDialog(null, "Tipo Especifico apagado com sucesso!"); this.dispose(); // TODO add your handling code here: } // GEN-LAST:event_jButton7ActionPerformed
private void formWindowClosing( java.awt.event.WindowEvent evt) { // GEN-FIRST:event_formWindowClosing nucleo.setEnab(true); this.dispose(); // TODO add your handling code here: } // GEN-LAST:event_formWindowClosing
public void update() throws Exception { String cod = txtcod.getText(); String nome = txtname.getText(); String tema = verTema(txtarea.getText()); nucleo.updateSpecific(cod, nome, tema); }
public void gravar() throws Exception { String nome = txtname.getText(); String tema = verTema(txtarea.getText()); nucleo.createSpecific(nome, tema); }
private void jButton9MouseClicked( java.awt.event.MouseEvent evt) { // GEN-FIRST:event_jButton9MouseClicked nucleo.setEnab(true); this.dispose(); } // GEN-LAST:event_jButton9MouseClicked