-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21ac089
commit 6ae7056
Showing
1,593 changed files
with
465,454 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="lib" path="D:/JavaProjects/mysql-connector-java-3.1.14-bin.jar"/> | ||
<classpathentry kind="lib" path="D:/JavaProjects/weblaf-1.27.jar"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>Swing26 - Tables</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Java CRUD App | ||
Simple java business application with CRUD functional made for university course. | ||
|
||
## `Note!`As it project became much visible somehow I strongly encourage to use provided code on your own risk. It is very dirty and hacky! | ||
|
||
To run it you need to have | ||
- Eclipse IDE (J2EE) **preferred** | ||
|
||
*or you need to install `JDK` on your own.* | ||
- MySQL pre-installed | ||
- some MySQL UI ( I used MySql Workbench ) | ||
- mysql-connector | ||
|
||
also i used `weblaf` swing look and feel. |
Binary file not shown.
Binary file added
BIN
+3.17 KB
Diff_java_projects/simple-java-crud-app-master/bin/controller/Controller.class
Binary file not shown.
Binary file added
BIN
+574 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/AgeCategory.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+834 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/EmploymentCategoryEditor$1.class
Binary file not shown.
Binary file added
BIN
+1.48 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/EmploymentCategoryEditor.class
Binary file not shown.
Binary file added
BIN
+962 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/EmploymentCategoryRenderer.class
Binary file not shown.
Binary file added
BIN
+1.62 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/FormEvent.class
Binary file not shown.
Binary file added
BIN
+189 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/FormListener.class
Binary file not shown.
Binary file added
BIN
+1014 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/FormPanel$1.class
Binary file not shown.
Binary file added
BIN
+2.16 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/FormPanel$2.class
Binary file not shown.
Binary file added
BIN
+7.91 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/FormPanel.class
Binary file not shown.
Binary file added
BIN
+1.33 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/IconRenderer.class
Binary file not shown.
Binary file added
BIN
+640 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame$1.class
Binary file not shown.
Binary file added
BIN
+1011 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame$10.class
Binary file not shown.
Binary file added
BIN
+1.39 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame$11.class
Binary file not shown.
Binary file added
BIN
+1.39 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame$12.class
Binary file not shown.
Binary file added
BIN
+992 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame$13.class
Binary file not shown.
Binary file added
BIN
+997 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame$14.class
Binary file not shown.
Binary file added
BIN
+591 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame$15.class
Binary file not shown.
Binary file added
BIN
+940 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame$2.class
Binary file not shown.
Binary file added
BIN
+940 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame$3.class
Binary file not shown.
Binary file added
BIN
+676 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame$4.class
Binary file not shown.
Binary file added
BIN
+1.18 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame$5.class
Binary file not shown.
Binary file added
BIN
+1.24 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame$6.class
Binary file not shown.
Binary file added
BIN
+1.62 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame$7.class
Binary file not shown.
Binary file added
BIN
+844 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame$8.class
Binary file not shown.
Binary file added
BIN
+988 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame$9.class
Binary file not shown.
Binary file added
BIN
+9.2 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/MainFrame.class
Binary file not shown.
Binary file added
BIN
+943 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/PersonFileFilter.class
Binary file not shown.
Binary file added
BIN
+151 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/PersonTableListener.class
Binary file not shown.
Binary file added
BIN
+2.94 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/PersonTableModel.class
Binary file not shown.
Binary file added
BIN
+736 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/TablePanel$1.class
Binary file not shown.
Binary file added
BIN
+1.07 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/TablePanel$2.class
Binary file not shown.
Binary file added
BIN
+1.23 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/TablePanel$3.class
Binary file not shown.
Binary file added
BIN
+3.03 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/TablePanel.class
Binary file not shown.
Binary file added
BIN
+1.02 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/TextPanel.class
Binary file not shown.
Binary file added
BIN
+648 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/TextPanel2$1.class
Binary file not shown.
Binary file added
BIN
+2.05 KB
Diff_java_projects/simple-java-crud-app-master/bin/gui/TextPanel2.class
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+178 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/gui/ToolbarListener.class
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+626 Bytes
...java_projects/simple-java-crud-app-master/bin/images/1400444437_save_accept.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+385 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/images/1400444440_Save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.18 KB
Diff_java_projects/simple-java-crud-app-master/bin/images/1400444542_save_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+673 Bytes
...va_projects/simple-java-crud-app-master/bin/images/1400444547_document-save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+826 Bytes
...ava_projects/simple-java-crud-app-master/bin/images/1400444559_view-refresh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+752 Bytes
...java_projects/simple-java-crud-app-master/bin/images/1400444563_Synchronize.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1008 Bytes
...java_projects/simple-java-crud-app-master/bin/images/1400444569_gtk-refresh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+577 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/images/1400444586_import.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+650 Bytes
...ava_projects/simple-java-crud-app-master/bin/images/1400444602_table-export.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+318 Bytes
...ple-java-crud-app-master/bin/images/1400444918_application_view_xp_terminal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+736 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/images/1400445120_Error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+448 Bytes
...jects/simple-java-crud-app-master/bin/images/1400445243_text_horizontalrule.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+640 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/images/1400445397_accept.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.4 KB
...va_projects/simple-java-crud-app-master/bin/images/1400445557_Windows_16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+817 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/images/1400445676_Help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.44 KB
...java_projects/simple-java-crud-app-master/bin/images/1400446085_Table_16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+942 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/images/1400447294_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+728 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/images/1400462129_cart_add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+801 Bytes
..._java_projects/simple-java-crud-app-master/bin/images/1400956144_gear__plus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+244 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/images/Refresh16.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+206 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/images/Save16.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+636 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/images/Server16.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+820 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/images/import1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+609 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/images/notepad.gif
Oops, something went wrong.
Binary file added
BIN
+774 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/images/price.png
Oops, something went wrong.
Oops, something went wrong.
Binary file added
BIN
+1.08 KB
Diff_java_projects/simple-java-crud-app-master/bin/model/AgeCategory.class
Binary file not shown.
Binary file added
BIN
+7.55 KB
Diff_java_projects/simple-java-crud-app-master/bin/model/Database.class
Binary file not shown.
Binary file added
BIN
+1.34 KB
Diff_java_projects/simple-java-crud-app-master/bin/model/EmploymentCategory.class
Binary file not shown.
Binary file added
BIN
+909 Bytes
Diff_java_projects/simple-java-crud-app-master/bin/model/Gender.class
Binary file not shown.
Binary file added
BIN
+4.04 KB
Diff_java_projects/simple-java-crud-app-master/bin/model/Person.class
Binary file not shown.
49 changes: 49 additions & 0 deletions
49
Diff_java_projects/simple-java-crud-app-master/src/TestDatabase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import java.sql.SQLException; | ||
|
||
import model.AgeCategory; | ||
import model.Database; | ||
import model.EmploymentCategory; | ||
import model.Gender; | ||
import model.Person; | ||
|
||
|
||
public class TestDatabase { | ||
|
||
public static void main(String[] args) | ||
{ | ||
|
||
|
||
System.out.println("Running database test"); | ||
|
||
Database db = new Database(); | ||
try { | ||
db.connect(); | ||
} catch (Exception e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
|
||
db.addPerson(new Person("Joe222","sdsdsdsd",AgeCategory.Nissan,EmploymentCategory.sklad,"2323",false,Gender.no)); | ||
db.addPerson(new Person("Joe222","sdsdsdsd",AgeCategory.Nissan,EmploymentCategory.sklad,"2323",false,Gender.no)); | ||
db.addPerson(new Person("Suzana","sdssdsdsdd",AgeCategory.Nissan,EmploymentCategory.sklad,"43",true,Gender.no)); | ||
db.addPerson(new Person("qwqw","sd12dd",AgeCategory.Mazda,EmploymentCategory.no,"43",true,Gender.yes)); | ||
db.addPerson(new Person("qwqw","sd12dd",AgeCategory.Mazda,EmploymentCategory.no,"43",true,Gender.yes)); | ||
db.addPerson(new Person("qwasasqw","sd12dd",AgeCategory.Mazda,EmploymentCategory.no,"43",true,Gender.yes)); | ||
|
||
try { | ||
db.save(); | ||
} catch (SQLException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
|
||
try { | ||
db.load(); | ||
} catch (SQLException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
db.disconnect(); | ||
} | ||
|
||
} |
119 changes: 119 additions & 0 deletions
119
Diff_java_projects/simple-java-crud-app-master/src/controller/Controller.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
package controller; | ||
|
||
import gui.FormEvent; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.sql.SQLException; | ||
import java.util.List; | ||
|
||
import model.AgeCategory; | ||
import model.Database; | ||
import model.EmploymentCategory; | ||
import model.Gender; | ||
import model.Person; | ||
|
||
public class Controller { | ||
Database db = new Database(); | ||
|
||
public List<Person> getPeople() { | ||
return db.getPeople(); | ||
} | ||
|
||
public void save() throws SQLException | ||
{ | ||
db.save(); | ||
} | ||
|
||
public void load() throws SQLException | ||
{ | ||
db.load(); | ||
} | ||
public void connect() throws Exception | ||
{ | ||
db.connect(); | ||
} | ||
|
||
public void disconnect() | ||
{ | ||
db.disconnect(); | ||
} | ||
|
||
|
||
|
||
public void addPerson(FormEvent ev) { | ||
String name = ev.getName(); | ||
String occupation = ev.getOccupation(); | ||
int ageCatId = ev.getAgeCategory(); | ||
String empCat = ev.getEmploymentCategory(); | ||
boolean isUs = ev.isUsCitizen(); | ||
String taxId = ev.getTaxId(); | ||
String gender = ev.getGender(); | ||
|
||
AgeCategory ageCategory = null; | ||
|
||
switch(ageCatId) { | ||
case 0: | ||
ageCategory = AgeCategory.Nissan; | ||
break; | ||
case 1: | ||
ageCategory = AgeCategory.Mazda; | ||
break; | ||
case 2: | ||
ageCategory = AgeCategory.Land_Rover; | ||
break; | ||
case 3: | ||
ageCategory = AgeCategory.Lada; | ||
break; | ||
case 4: | ||
ageCategory = AgeCategory.Honda; | ||
break; | ||
|
||
} | ||
|
||
|
||
EmploymentCategory empCategory; | ||
|
||
if(empCat.equals("åñòü")) { | ||
empCategory = EmploymentCategory.yes; | ||
} | ||
else if(empCat.equals("íåò")) { | ||
empCategory = EmploymentCategory.no; | ||
} | ||
else if(empCat.equals("ñêëàä")) { | ||
empCategory = EmploymentCategory.sklad; | ||
} | ||
else { | ||
empCategory = EmploymentCategory.other; | ||
System.err.println(empCat); | ||
} | ||
|
||
Gender genderCat; | ||
|
||
if(gender.equals("yes")) { | ||
genderCat = Gender.yes; | ||
} | ||
else { | ||
genderCat = Gender.no; | ||
} | ||
|
||
Person person = new Person(name, occupation, ageCategory, empCategory, | ||
taxId, isUs, genderCat); | ||
|
||
db.addPerson(person); | ||
} | ||
public void removePerson(int index) | ||
{ | ||
db.removePerson(index); | ||
} | ||
|
||
public void saveToFile(File file) throws IOException | ||
{ | ||
db.saveToFile(file); | ||
} | ||
public void loadFromFile(File file) throws IOException | ||
{ | ||
db.loadFromFile(file); | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
Diff_java_projects/simple-java-crud-app-master/src/gui/App.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package gui; | ||
import javax.swing.SwingUtilities; | ||
|
||
public class App { | ||
|
||
public static void main(String[] args) { | ||
|
||
SwingUtilities.invokeLater(new Runnable() { | ||
public void run() { | ||
new MainFrame(); | ||
} | ||
}); | ||
} | ||
|
||
} |
59 changes: 59 additions & 0 deletions
59
Diff_java_projects/simple-java-crud-app-master/src/gui/EmploymentCategoryEditor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package gui; | ||
|
||
import java.awt.Component; | ||
import java.awt.event.ActionEvent; | ||
import java.awt.event.ActionListener; | ||
import java.util.EventObject; | ||
|
||
import javax.swing.AbstractCellEditor; | ||
import javax.swing.JComboBox; | ||
import javax.swing.JTable; | ||
import javax.swing.table.TableCellEditor; | ||
|
||
import model.EmploymentCategory; | ||
|
||
public class EmploymentCategoryEditor extends AbstractCellEditor implements TableCellEditor { | ||
|
||
private JComboBox combo; | ||
|
||
public EmploymentCategoryEditor() | ||
{ | ||
combo = new JComboBox(EmploymentCategory.values()); | ||
} | ||
@Override | ||
public boolean isCellEditable(EventObject e) { | ||
|
||
return true; | ||
} | ||
|
||
@Override | ||
public Object getCellEditorValue() { | ||
// TODO Auto-generated method stub | ||
return combo.getSelectedItem(); | ||
} | ||
|
||
@Override | ||
public Component getTableCellEditorComponent(JTable table, Object value, | ||
boolean isSelected, int row, int column) { | ||
|
||
|
||
combo.setSelectedItem(value); | ||
|
||
combo.addActionListener(new ActionListener() | ||
{ | ||
|
||
@Override | ||
public void actionPerformed(ActionEvent arg0) { | ||
fireEditingStopped(); | ||
|
||
} | ||
|
||
}); | ||
|
||
|
||
return combo; | ||
} | ||
|
||
|
||
|
||
} |
27 changes: 27 additions & 0 deletions
27
Diff_java_projects/simple-java-crud-app-master/src/gui/EmploymentCategoryRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package gui; | ||
|
||
import java.awt.Component; | ||
|
||
import javax.swing.JComboBox; | ||
import javax.swing.JTable; | ||
import javax.swing.table.TableCellRenderer; | ||
|
||
import model.EmploymentCategory; | ||
|
||
public class EmploymentCategoryRenderer implements TableCellRenderer { | ||
|
||
private JComboBox combo; | ||
|
||
public EmploymentCategoryRenderer() { | ||
combo = new JComboBox(EmploymentCategory.values()); | ||
} | ||
|
||
@Override | ||
public Component getTableCellRendererComponent(JTable table, Object value, | ||
boolean isSelected, boolean hasFocus, int row, int column) { | ||
|
||
combo.setSelectedItem(value); | ||
return combo; | ||
} | ||
|
||
} |
69 changes: 69 additions & 0 deletions
69
Diff_java_projects/simple-java-crud-app-master/src/gui/FormEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package gui; | ||
import java.awt.event.KeyEvent; | ||
import java.util.EventObject; | ||
|
||
public class FormEvent extends EventObject { | ||
|
||
private String name; | ||
private String occupation; | ||
private int ageCategory; | ||
private String empCat; | ||
private String taxId; | ||
private boolean usCitizen; | ||
private String gender; | ||
|
||
public FormEvent(Object source) { | ||
super(source); | ||
} | ||
|
||
public FormEvent(Object source, String name, String occupation, int ageCat, | ||
String empCat, String taxId, boolean usCitizen, String gender) { | ||
super(source); | ||
|
||
this.name = name; | ||
this.occupation = occupation; | ||
this.ageCategory = ageCat; | ||
this.empCat = empCat; | ||
this.taxId = taxId; | ||
this.usCitizen = usCitizen; | ||
this.gender = gender; | ||
} | ||
|
||
public String getGender() { | ||
return gender; | ||
} | ||
|
||
public String getTaxId() { | ||
return taxId; | ||
} | ||
|
||
public boolean isUsCitizen() { | ||
return usCitizen; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getOccupation() { | ||
return occupation; | ||
} | ||
|
||
public void setOccupation(String occupation) { | ||
this.occupation = occupation; | ||
} | ||
|
||
public int getAgeCategory() { | ||
return ageCategory; | ||
} | ||
|
||
public String getEmploymentCategory() { | ||
return empCat; | ||
} | ||
|
||
|
||
} |
6 changes: 6 additions & 0 deletions
6
Diff_java_projects/simple-java-crud-app-master/src/gui/FormListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package gui; | ||
import java.util.EventListener; | ||
|
||
public interface FormListener extends EventListener { | ||
public void formEventOccurred(FormEvent e); | ||
} |
Oops, something went wrong.