Posts

Showing posts with the label Swing

Puzzle

Image
It's fun making games. Even this simple. Wish I had rights for this awesome background pic. Main.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 package mhgpuzzletest; import java.awt.BorderLayout; import java.awt.Cursor; import java.awt.Image; import java.awt.LayoutManager; import java.awt.Point; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.io.IOException; import javax.imageio.ImageIO; import javax.swing.JButton; import javax.swing.JFrame; /** * * @author djordje gavrilovic */ public class Main extends JFrame { static JButton reset; static Main frame; static Cursor cursor; public Main() throws IOException { // custom-cursor. not full color on Linux Toolkit tk = Toolkit.getDefaultToolkit(); Image img = ImageIO.read(getClass(...

Employee management system 2

Image
This is a bit enhanced version of employee management system project that I've done before. The GUI is generally the same, except that the data is now displayed inside tables and some colors are changed. Important thing is that ORM is done with Hibernate and HQL.  The code is shown for just two frames (PrikazFrame and IzmenaFrame) out of 5. hibernate.cfg.xml 1: <?xml version="1.0" encoding="UTF-8"?> 2: <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> 3: 4: <hibernate-configuration> 5: <session-factory> 6: <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> 7: <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> 8: <property name="hibernate.connection.url"...

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...