diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..83dfc23 --- /dev/null +++ b/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project Floating Notification. + + + diff --git a/build/built-jar.properties b/build/built-jar.properties new file mode 100644 index 0000000..e1fbecd --- /dev/null +++ b/build/built-jar.properties @@ -0,0 +1,4 @@ +#Thu, 03 Oct 2019 17:57:43 -0300 + + +C\:\\Users\\Abner\\Documents\\NetBeansProjects\\Floating\ Notification= diff --git a/build/classes/com/kingaspx/menu/Menu$1.class b/build/classes/com/kingaspx/menu/Menu$1.class new file mode 100644 index 0000000..d873ea2 Binary files /dev/null and b/build/classes/com/kingaspx/menu/Menu$1.class differ diff --git a/build/classes/com/kingaspx/menu/Menu$2.class b/build/classes/com/kingaspx/menu/Menu$2.class new file mode 100644 index 0000000..cd898ad Binary files /dev/null and b/build/classes/com/kingaspx/menu/Menu$2.class differ diff --git a/build/classes/com/kingaspx/menu/Menu.class b/build/classes/com/kingaspx/menu/Menu.class new file mode 100644 index 0000000..49e0c25 Binary files /dev/null and b/build/classes/com/kingaspx/menu/Menu.class differ diff --git a/build/classes/com/kingaspx/util/Toast$ToastMessage$1.class b/build/classes/com/kingaspx/util/Toast$ToastMessage$1.class new file mode 100644 index 0000000..c088040 Binary files /dev/null and b/build/classes/com/kingaspx/util/Toast$ToastMessage$1.class differ diff --git a/build/classes/com/kingaspx/util/Toast$ToastMessage.class b/build/classes/com/kingaspx/util/Toast$ToastMessage.class new file mode 100644 index 0000000..e91e9c3 Binary files /dev/null and b/build/classes/com/kingaspx/util/Toast$ToastMessage.class differ diff --git a/build/classes/com/kingaspx/util/Toast.class b/build/classes/com/kingaspx/util/Toast.class new file mode 100644 index 0000000..edbc9d6 Binary files /dev/null and b/build/classes/com/kingaspx/util/Toast.class differ diff --git a/dist/Floating_Notification.jar b/dist/Floating_Notification.jar new file mode 100644 index 0000000..bcbc233 Binary files /dev/null and b/dist/Floating_Notification.jar differ diff --git a/dist/README.TXT b/dist/README.TXT new file mode 100644 index 0000000..51949f7 --- /dev/null +++ b/dist/README.TXT @@ -0,0 +1,32 @@ +======================== +BUILD OUTPUT DESCRIPTION +======================== + +When you build an Java application project that has a main class, the IDE +automatically copies all of the JAR +files on the projects classpath to your projects dist/lib folder. The IDE +also adds each of the JAR files to the Class-Path element in the application +JAR files manifest file (MANIFEST.MF). + +To run the project from the command line, go to the dist folder and +type the following: + +java -jar "Floating_Notification.jar" + +To distribute this project, zip up the dist folder (including the lib folder) +and distribute the ZIP file. + +Notes: + +* If two JAR files on the project classpath have the same name, only the first +JAR file is copied to the lib folder. +* Only JAR files are copied to the lib folder. +If the classpath contains other types of files or folders, these files (folders) +are not copied. +* If a library on the projects classpath also has a Class-Path element +specified in the manifest,the content of the Class-Path element has to be on +the projects runtime path. +* To set a main class in a standard Java project, right-click the project node +in the Projects window and choose Properties. Then click Run and enter the +class name in the Main Class field. Alternatively, you can manually type the +class name in the manifest Main-Class element. diff --git a/dist/lib/AbsoluteLayout.jar b/dist/lib/AbsoluteLayout.jar new file mode 100644 index 0000000..a763ffb Binary files /dev/null and b/dist/lib/AbsoluteLayout.jar differ diff --git a/dist/lib/KControls.jar b/dist/lib/KControls.jar new file mode 100644 index 0000000..bd44070 Binary files /dev/null and b/dist/lib/KControls.jar differ diff --git a/manifest.mf b/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml new file mode 100644 index 0000000..29b33c8 --- /dev/null +++ b/nbproject/build-impl.xml @@ -0,0 +1,1768 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties new file mode 100644 index 0000000..88c9d02 --- /dev/null +++ b/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=dcc8ffaf +build.xml.script.CRC32=b96399f1 +build.xml.stylesheet.CRC32=f85dc8f2@1.92.0.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=dcc8ffaf +nbproject/build-impl.xml.script.CRC32=975244be +nbproject/build-impl.xml.stylesheet.CRC32=3a2fa800@1.92.0.48 diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties new file mode 100644 index 0000000..5d181f0 --- /dev/null +++ b/nbproject/private/private.properties @@ -0,0 +1,2 @@ +compile.on.save=true +user.properties.file=C:\\Users\\Abner\\AppData\\Roaming\\NetBeans\\11.1\\build.properties diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 0000000..2975b16 --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,98 @@ +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.modulepath=\ + ${run.modulepath} +debug.test.classpath=\ + ${run.test.classpath} +debug.test.modulepath=\ + ${run.test.modulepath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/Floating_Notification.jar +dist.javadoc.dir=${dist.dir}/javadoc +dist.jlink.dir=${dist.dir}/jlink +dist.jlink.output=${dist.jlink.dir}/Floating_Notification +excludes= +file.reference.KControls.jar=C:\\Users\\Abner\\Documents\\Bibiloteca Java\\Painel Gradiente\\KControls.jar +includes=** +jar.compress=false +javac.classpath=\ + ${libs.absolutelayout.classpath}:\ + ${file.reference.KControls.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.modulepath= +javac.processormodulepath= +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.modulepath=\ + ${javac.modulepath} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.html5=false +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +# The jlink additional root modules to resolve +jlink.additionalmodules= +# The jlink additional command line parameters +jlink.additionalparam= +jlink.launcher=true +jlink.launcher.name=Floating_Notification +main.class=com.kingaspx.menu.Menu +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.modulepath=\ + ${javac.modulepath} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +run.test.modulepath=\ + ${javac.test.modulepath} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..6f5f817 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + Floating Notification + + + + + + + + + diff --git a/src/com/kingaspx/menu/Menu.form b/src/com/kingaspx/menu/Menu.form new file mode 100644 index 0000000..d6ae801 --- /dev/null +++ b/src/com/kingaspx/menu/Menu.form @@ -0,0 +1,91 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/com/kingaspx/menu/Menu.java b/src/com/kingaspx/menu/Menu.java new file mode 100644 index 0000000..e51f497 --- /dev/null +++ b/src/com/kingaspx/menu/Menu.java @@ -0,0 +1,92 @@ +package com.kingaspx.menu; + +import com.kingaspx.util.Toast; +import java.awt.Color; + +public class Menu extends javax.swing.JFrame { + + public Menu() { + initComponents(); + } + + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jPanel1 = new javax.swing.JPanel(); + msg_txt = new javax.swing.JTextField(); + jLabel2 = new javax.swing.JLabel(); + jButton1 = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + + jPanel1.setBackground(new java.awt.Color(255, 255, 255)); + jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + jPanel1.add(msg_txt, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 80, 100, 20)); + + jLabel2.setText("Message"); + jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(150, 66, -1, -1)); + + jButton1.setText("Show"); + 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(140, 110, -1, -1)); + + jLabel1.setFont(new java.awt.Font("Segoe UI Black", 0, 24)); // NOI18N + jLabel1.setText("Floating Notification"); + jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, -1, -1)); + + getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 350, 140)); + + setSize(new java.awt.Dimension(357, 180)); + setLocationRelativeTo(null); + }// //GEN-END:initComponents + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + new Toast(new Color(31, 64, 55), new Color(153, 242, 200)); + }//GEN-LAST:event_jButton1ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + // + /* 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 ("Windows".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + // + + // + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new Menu().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JPanel jPanel1; + private javax.swing.JTextField msg_txt; + // End of variables declaration//GEN-END:variables +} diff --git a/src/com/kingaspx/util/Toast.java b/src/com/kingaspx/util/Toast.java new file mode 100644 index 0000000..03e0c92 --- /dev/null +++ b/src/com/kingaspx/util/Toast.java @@ -0,0 +1,72 @@ +package com.kingaspx.util; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Toolkit; +import javax.swing.JDialog; +import javax.swing.JLabel; +import keeptoo.KGradientPanel; + +public class Toast { + + String message; + + public Toast(Color startColor, Color endColor) { +// this.message = message; + ToastMessage tMessage = new ToastMessage("Successful", 3000, startColor, endColor); + tMessage.setVisible(true); + } + + public class ToastMessage extends JDialog { + + int miliseconds; + + public ToastMessage(String toastString, int time, Color startColor, Color endColor) { + this.miliseconds = time; + setUndecorated(true); + getContentPane().setLayout(new BorderLayout(0, 0)); + + KGradientPanel panel = new KGradientPanel(); + panel.setkStartColor(startColor); + panel.setkEndColor(endColor); + panel.setOpaque(false); + getContentPane().add(panel, BorderLayout.CENTER); + setBackground(new Color(0, 0, 0, 0)); + + JLabel toastLabel = new JLabel(""); + toastLabel.setText(toastString); + toastLabel.setFont(new Font("Segoe UI", Font.BOLD, 14)); + toastLabel.setForeground(Color.WHITE); + + setBounds(100, 100, toastLabel.getPreferredSize().width + 30, 31); + + setAlwaysOnTop(true); + + Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); + int y = dim.height / 2 - getSize().height / 2; + int half = y / 2; + setLocation(dim.width / 2 - getSize().width / 2, y + half); + + panel.add(toastLabel); +// setOpacity(0.7f); + setVisible(false); + + new Thread() { + @Override + public void run() { + try { + Thread.sleep(miliseconds); + dispose(); + } catch (Exception e) { + e.printStackTrace(); + } + } + }.start(); + + } + + } + +}