Baixe o app para aproveitar ainda mais
Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original
RelogioJava/build/classes/.netbeans_automatic_build RelogioJava/build/classes/.netbeans_update_resources RelogioJava/build/classes/relogiojava/Interface_Teste$1.class package relogiojava; synchronized class Interface_Teste$1 implements java.awt.event.ActionListener { void Interface_Teste$1(Interface_Teste); public void actionPerformed(java.awt.event.ActionEvent); } RelogioJava/build/classes/relogiojava/Interface_Teste$2.class package relogiojava; final synchronized class Interface_Teste$2 implements Runnable { void Interface_Teste$2(); public void run(); } RelogioJava/build/classes/relogiojava/Interface_Teste.class package relogiojava; public synchronized class Interface_Teste extends javax.swing.JFrame { private javax.swing.JButton jButton1; private JLabelTime jLabelTime1; public void Interface_Teste(); private void initComponents(); private void jButton1ActionPerformed(java.awt.event.ActionEvent); public static void main(String[]); } RelogioJava/build/classes/relogiojava/Interface_Teste.form RelogioJava/build/classes/relogiojava/JLabelTime$1.class package relogiojava; synchronized class JLabelTime$1 implements java.awt.event.ActionListener { void JLabelTime$1(JLabelTime); public void actionPerformed(java.awt.event.ActionEvent); } RelogioJava/build/classes/relogiojava/JLabelTime.class package relogiojava; public synchronized class JLabelTime extends javax.swing.JLabel { int hh; int mm; int ss; int pmAm; java.util.Calendar hora; java.text.DecimalFormat formato; java.awt.event.ActionListener ativar; public void JLabelTime(); private void HORAS(); private String formatar(int); } RelogioJava/build.xml Builds, tests, and runs the project RelogioJava. RelogioJava/manifest.mf Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build RelogioJava/nbproject/build-impl.xml Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes No tests executed. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url RelogioJava/nbproject/genfiles.properties build.xml.data.CRC32=90290dcf build.xml.script.CRC32=1f9813f7 build.xml.stylesheet.CRC32=8064a381@1.74.2.48 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=90290dcf nbproject/build-impl.xml.script.CRC32=b4097cf8 nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.74.2.48 RelogioJava/nbproject/private/private.properties compile.on.save=true user.properties.file=C:\\Users\\JHUNIOR\\AppData\\Roaming\\NetBeans\\8.0\\build.properties RelogioJava/nbproject/project.properties annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # Os arquivos em build.classes.dir que devem ser exclu\u00eddos do jar de distribui\u00e7\u00e3o dist.archive.excludes= # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/RelogioJava.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.processorpath=\ ${javac.classpath} javac.source=1.7 javac.target=1.7 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=relogiojava.Interface_Teste manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys-prop.name=value: run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test RelogioJava/nbproject/project.xml org.netbeans.modules.java.j2seproject RelogioJava RelogioJava/src/relogiojava/Interface_Teste.form RelogioJava/src/relogiojava/Interface_Teste.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package relogiojava; /** * * @author JHUNIOR */ public class Interface_Teste extends javax.swing.JFrame { /** * Creates new form Interface_Teste */ public Interface_Teste() { initComponents(); } /** * 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">//GEN-BEGIN:initComponents private void initComponents() { jLabelTime1 = new relogiojava.JLabelTime(); jButton1 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabelTime1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabelTime1.setFont(new java.awt.Font("Agency FB", 1, 48)); // NOI18N jButton1.setText("Fechar Relógio"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabelTime1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabelTime1, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed System.exit(0); }//GEN-LAST:event_jButton1ActionPerformed /** * @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(Interface_Teste.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Interface_Teste.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Interface_Teste.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Interface_Teste.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Interface_Teste().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private relogiojava.JLabelTime jLabelTime1; // End of variables declaration//GEN-END:variables } RelogioJava/src/relogiojava/JLabelTime.java /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package relogiojava; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.text.DecimalFormat; import java.util.Calendar; import javax.swing.JLabel; import javax.swing.Timer; /** * * @author JHUNIOR */ public class JLabelTime extends JLabel { //declarando os componentes da janela //declarando variáveis int hh,mm,ss,pmAm; //* Calendar hora; //*Hora DecimalFormat formato; //* /* abrindo o método construtor da classe * Esse trecho do código [ou da clase] será o resposável pela CONSTRUÇÃO da interface gráfica na memória, * por isso tem esse nome. * o construtor deve ser público e ter o mesmo nome da classe, * lembrando que java é case sensitive, então o nome do construtor deve ser identico ao da classe. */ public JLabelTime() { //definindo tamanho e layout da janela setSize (100,55); setLayout(new FlowLayout()); //falaremos mais tarde sobre layouts //definindo operação padrão para o botão fechar new JLabel("");//configurando o label inicial Timer time = new Timer(1000,ativar); time.start(); } private void HORAS(){ hora = Calendar.getInstance(); hh = hora.get(Calendar.HOUR_OF_DAY); mm = hora.get(Calendar.MINUTE); ss = hora.get(Calendar.SECOND); pmAm = hora.get(Calendar.AM_PM); //if(pmAm != Calendar.AM && pmAm != Calendar.PM) setText(formatar(hh)+":"+formatar(mm)+":"+formatar(ss));// Aqui você Monta o moledo do RELÓGIO // else //setText(formatar(hh)+":"+formatar(mm)+":"+formatar(ss)+" "+(pmAm==Calendar.AM?"am":"pm")); } private String formatar(int num){ formato = new DecimalFormat("00"); return formato.format(num); } ActionListener ativar = ( new ActionListener(){ public void actionPerformed(ActionEvent e){ HORAS(); } } ); /* Abrindo o método principal da classe [Main em inglês significa principal] * Este método deve ser público, estático e vazio, ou seja, sempre vai ter a mesma estrutura; * Na sua criação é definida uma String, que receberá possiveis argumentos passados pelo usuário. * o nome da string costuma ser args [por abreviação de argumentos] * mas pode ser outro nome qualquer, como a, argumentos, parametros, param, etc * * mais tarde podemos trabalhar com classes usando argumentos para String */ }
Compartilhar