Posts

Showing posts with the label JavaSE

Employee management system

Image
But it's a very simple system. And with a nicer Swing GUI, which is mostly created using NetBeans design tool. It's just a simple Swing/SQL/Persistence... exercise. It stores and manges data (name, age, address, income) about employees. Application functionalities are: display of all employees, showing only certain employees according to one of the criteria, change of employee data based on criteria, deleting an employee based on the criteria and entry of new employees. Only a few classes are shown, because logic is mostly the same...  And there is a bit enhanced Hibernate/HQL version. Main.java 1: package zaposlenisistem; 2: 3: import java.awt.Color; 4: import javax.swing.UIManager; 5: 6: /** 7: * 8: * @author djordje 9: */ 10: public class Main { 11: public static void main(String[] args) { 12: try { 13: UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); 14: } catch...

Java Swing timer app

Image
Again, quite simple app for Swing exercise. The application should be run in OS system tray. By clicking on the tray icon, a popup menu appears with two options: Settings and Close. By clicking Close, the application closes. By clicking Settings, the first window opens, which should contain all the controls.  After a defined time or at a defined time, it is necessary for another window to appear, whose background will change color, with the background color and the change rate depending on the settings in the first window.   The second window should appear after the expiration timer defined waiting time. In the first case (onTime) - at the right time, or in the second case (countdown) - after the selected number of minutes. Of course, one option disables the other one.   The Choose color button displays a dialog with the color palette, where after selection, the color will be displayed in the label next to it.   It is only important that the chosen color ...

Multithread client-server app

Image
Little c/s app with an ugly AWT gui. But it's a nice multithread/socket/awt exercise. This application simply adds two numbers. The operation itself needs to be performed on the server, which accepts two assemblies and delivers the result to client. The client component consists of two input fields, the startup key and the field to show the result of the operation. The server component needs to receive data from the client, to parse them and perform calculations, and finally deliver the solution to the client. It's done within a single project.   Main.java 1: /* 2: * Djordje Gavrilovic 3: * Mar 23, 2017 4: */ 5: package ajpa1; 6: 7: public class Main { 8: public static void main(String[] args) { 9: Server s = new Server(); 10: Klijent k = new Klijent(); 11: 12: s.start(); 13: k.start(); 14: 15: } 16: 17: } Klijent.java 1: package ajpa1; 2: 3: import java.io.IOE...