* MarketApp.java
*/
package market;
import com.conn.SettingUI;
import com.util.FormUtil;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.sql.Connection;
import model.AdminModel;
import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;
/**
* The main class of the application.
*/
public class MarketApp extends SingleFrameApplication {
/**
* At startup create and show the main frame of the application.
*/
public SingleFrameApplication getApp(){
return this;
}
private MarketView jMainMenu;
private Connection jConnection;
private AdminModel jAdmin;
private SettingUI jConfig;
public SettingUI getConfig(){
return jConfig;
}
public void showMainMenu(){
show(jMainMenu);
}
public MarketView getMainMenu(){
return jMainMenu;
}
public Connection getConnection(){
return jConnection;
}
public void setConnection(Connection value) {
jConnection = value;
}
public void setAdminObj (AdminModel vAdmin){
jAdmin=vAdmin;
}
public AdminModel getAdminObj(){
return jAdmin;
}
//------------------------------------------------------//
@Override protected void startup() {
jMainMenu = new MarketView(this);
jConfig = new SettingUI(null, true);
jConfig.makeConnect();
if (jConfig.isConnected()==true){
jConnection = jConfig.getConnection();
}
else {
jConfig.setVisible(true);
jConnection=jConfig.getConnection();
if (jConfig.isConnected()==false)
jMainMenu.getApplication().exit();
}
FormUtil.setMainFrame(
jMainMenu.getFrame());
}
@Override protected void configureWindow(java.awt.Window root) {
root.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
// write your code here
MarketApp.getApplication().exit();
}
});
}
/**
* A convenient static getter for the application instance.
* @return the instance of MarketApp
*/
public static MarketApp getApplication() {
return Application.getInstance(MarketApp.class);
}
/**
* Main method launching the application.
*/
public static void main(String[] args) {
launch(MarketApp.class, args);
}
}
--------------------------------------------------------------------------------------------------------
package model;
import com.db.DBQuery;
import java.sql.Connection;
public class AdminModel {
private String getPrivilegeItem(boolean vPriv){
String result ="";
if (vPriv) { result= "1";
}
else
result="0";
return result;
}
public void PrivilegeSetup () {
String [] mPriv;
mPriv = new String[10];
mPriv[PrivIndex.Admin.ordinal ()] = getPrivilegeItem(PrivilegeAdmin);
mPriv[PrivIndex.Barang.ordinal ()] = getPrivilegeItem(PrivilegeBarang);
mPriv[PrivIndex.Pemasok.ordinal ()] = getPrivilegeItem(PrivilegePemasok);
mPriv[PrivIndex.Pelanggan.ordinal ()] = getPrivilegeItem(PrivilegePelanggan);
mPriv[PrivIndex.Box.ordinal ()] = getPrivilegeItem(PrivilegeBox);
mPriv[PrivIndex.Pembelian.ordinal ()] = getPrivilegeItem(PrivilegePembelian);
mPriv[PrivIndex.Pembayaran.ordinal ()] = getPrivilegeItem(PrivilegePembayaran);
mPriv[PrivIndex.Penjualan.ordinal ()] = getPrivilegeItem(PrivilegePenjualan);
mPriv[PrivIndex.Penerimaan.ordinal ()] = getPrivilegeItem(PrivilegePenerimaan);
privileges="";
for ( int i=0; i
privileges = privileges + mPriv[i].toString();
}
}
public enum PrivIndex {
Admin,Barang, Pemasok, Pelanggan, Box, Pembelian, Pembayaran, Penjualan, Penerimaan
}
private Connection jConnection;
public boolean isInsert=true;
public String kd_user;
public String user_name;
public String user_pass;
public String privileges;
public String ExceptionMessage="";
private boolean PrivilegeAdmin=false;
private boolean PrivilegeBarang=false;
private boolean PrivilegePemasok=false;
private boolean PrivilegePelanggan=false;
private boolean PrivilegeBox=false;
private boolean PrivilegePembelian=false;
private boolean PrivilegePembayaran=false;
private boolean PrivilegePenjualan=false;
private boolean PrivilegePenerimaan=false;
public void setPrivilegeAdmin(boolean vPriv) {
PrivilegeAdmin=vPriv;
}
public void setPrivilegeBarang(boolean vPriv) {
PrivilegeBarang=vPriv;
}
public void setPrivilegePemasok(boolean vPriv) {
PrivilegePemasok=vPriv;
}
public void setPrivilegePelanggan(boolean vPriv) {
PrivilegePelanggan=vPriv;
}
public void setPrivilegeBox(boolean vPriv) {
PrivilegeBox=vPriv;
}
public void setPrivilegePembelian(boolean vPriv) {
PrivilegePembelian=vPriv;
}
public void setPrivilegePembayaran(boolean vPriv) {
PrivilegePembayaran=vPriv;
}
public void setPrivilegePenjualan(boolean vPriv) {
PrivilegePenjualan=vPriv;
}
public void setPrivilegePenerimaan(boolean vPriv) {
PrivilegePenerimaan=vPriv;
}
public boolean getPrivilegeAdmin(){
return PrivilegeAdmin;
}
public boolean getPrivilegeBarang(){
return PrivilegeBarang;
}
public boolean getPrivilegePemasok(){
return PrivilegePemasok;
}
public boolean getPrivilegePelanggan(){
return PrivilegePelanggan;
}
public boolean getPrivilegeBox(){
return PrivilegeBox;
}
public boolean getPrivilegePembelian(){
return PrivilegePembelian;
}
public boolean getPrivilegePembayaran(){
return PrivilegePembayaran;
}
public boolean getPrivilegePenjualan(){
return PrivilegePenjualan;
}
public boolean getPrivilegePenerimaan(){
return PrivilegePenerimaan;
}
public void setConnection(Connection vCon){
jConnection = vCon;
}
public AdminModel (){
}
public boolean saveAdmin (){
boolean result=false;
String strQ="";
DBQuery q = new DBQuery();
q.setConnection(jConnection);
if (isInsert==true)
strQ="insert into admin set";
else
strQ="update admin set";
strQ=strQ +" user_name=? " + ", user_pass=?,privileges=?";
if (isInsert==true)
strQ=strQ + ", kd_user=? ";
else
strQ = strQ + ", where kd_user=? ";
q.setStrSql(strQ);
q.preparedStatement();
try {
q.params().setString(1, user_name);
q.params().setString(2, user_pass);
q.params().setString(3, privileges);
q.params().setString(4, kd_user);
q.params().executeUpdate();
result=true;
}
catch (Exception e) {
System.out.println(e);
}
return result;
}
public boolean getAdmin(String vID) {
boolean result =false;
String strQ="";
String FieldList="user_name"+ ", user_pass, privileges";
strQ="select"+ FieldList + "from admin" + "where kd_user = '" + vID +"'";
try {
DBQuery q = new DBQuery();
q.setConnection(jConnection);
q.setStrSql(strQ);
q.makeResulset();
if (q.next()==false)
return false;
kd_user = vID;
user_name = q.getString(1);
user_pass = q.getString(2);
readPrivileges(q.getString(3));
result=true;
}
catch (Exception e){
System.out.println(e);
}
return result;
}
public boolean isInvalidLogin (String vUserID, String vPass){
boolean result = false;
try {
DBQuery ql = new DBQuery();
ql.setConnection(jConnection);
String strSql=
"select kd_user, user_name" +
", user_pass, privileges from admin" +
"where user_name= '" + vUserID +
"' AND user_pass = ('" + vPass + "')";
ql.setStrSql(strSql);
ql.makeResulset();
if (ql.next()) {
result=true;
kd_user = ql.getString(1);
user_name= ql.getString(2);
user_pass=ql.getString(3);
privileges=ql.getString(4);
readPrivileges(privileges);
}
}
catch (Exception ex){
System.out.println(ex);
}
return result;
}
public boolean cekRefrens (
String vTable, String vID) {
boolean result=false;
try
{
DBQuery q = new DBQuery();
q.setConnection(jConnection);
q.setStrSql("select * from "+ vTable + "where kd_user ='" +vID + "'");
q.makeResulset();
if (q.getRowCount()>0)
result=true;
}
catch (Exception e){
}
return result;
}
public boolean deleteAdmin(String vID) {
boolean result = false;
try {
DBQuery q = new DBQuery();
q.setConnection(jConnection);
q.setStrSql("delete from admin" + "where kd_user='" + vID + "'");
q.preparedStatement();
q.executeUpdate();
result =true;
} catch (Exception e ){
}
return result;
}
private boolean getPriveValue(
PrivIndex vIndex, String vPriv) {
boolean result = false;
String mValue="";
try
{ mValue=vPriv.substring(vIndex.ordinal()+1);
if (mValue.equals("1")){
result=true;
}
}
catch (Exception e) {
}
return result;
}
private void readPrivileges(String vPriv){
try {
PrivilegeAdmin =
getPriveValue(PrivIndex.Admin, vPriv);
PrivilegeBarang =
getPriveValue(PrivIndex.Barang, vPriv);
PrivilegePelanggan =
getPriveValue(PrivIndex.Pelanggan, vPriv);
PrivilegePemasok =
getPriveValue(PrivIndex.Pemasok, vPriv);
PrivilegeBox =
getPriveValue(PrivIndex.Box, vPriv);
PrivilegePembelian =
getPriveValue(PrivIndex.Pembelian, vPriv);
PrivilegePembayaran =
getPriveValue(PrivIndex.Pembayaran, vPriv);
PrivilegePenjualan =
getPriveValue(PrivIndex.Penjualan, vPriv);
PrivilegePenerimaan =
getPriveValue(PrivIndex.Penerimaan, vPriv);
}
catch (Exception e){
}
}
}
-------------------------------------------------------------------------------------------------------
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package market;
/**
*
* @author LOBSTER
*/
public class MyApp {
private static MarketApp app;
public static MarketApp getApp(){
return app;
}
static{
app = MarketApp.getApplication();
}
}
-------------------------------------------------------------------------------------------------------
/*
* MarketView.java
*/
package market;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DateFormat;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import model.AdminModel;
/**
* The application's main frame.
*/
public class MarketView extends FrameView {
// tambahin tampilan jam pada fontpage//
private void tampilJam(){
java.util.Date dt = new java.util.Date();
String myString = DateFormat.getDateInstance().format(dt);
lblTime.setText(myString);
}
class ThreadJam extends Thread{
public void run() {
while (true) {
tampilJam();
try {
Thread.sleep(1000);
}
catch (InterruptedException e) {}
}
}
}
//----------------------------------------------//
public void setupPrivilege(){
AdminModel adm =
MyApp.getApp().getAdminObj();
lblUser.setText(adm.user_name);
menuBox.setEnabled(adm.getPrivilegeBox());
menuBarang.setEnabled(
adm.getPrivilegeBarang());
menuPemasok.setEnabled(
adm.getPrivilegePemasok());
menuPelanggan.setEnabled(
adm.getPrivilegePelanggan());
menuAdmin.setEnabled(
adm.getPrivilegeAdmin());
menuPembelian.setEnabled(
adm.getPrivilegePembelian());
menuPembayaran.setEnabled(
adm.getPrivilegePembayaran());
menuPenjualan.setEnabled(
adm.getPrivilegePenjualan());
menuPenerimaan.setEnabled(
adm.getPrivilegePenerimaan());
}
public MarketView(SingleFrameApplication app) {
super(app);
initComponents();
ThreadJam terima = new ThreadJam();
terima.start();
// status bar initialization - message timeout, idle icon and busy animation, etc
ResourceMap resourceMap = getResourceMap();
int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
messageTimer = new Timer(messageTimeout, new ActionListener() {
public void actionPerformed(ActionEvent e) {
statusMessageLabel.setText("");
}
});
messageTimer.setRepeats(false);
int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
for (int i = 0; i < busyIcons.length; i++) {
busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
}
busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
public void actionPerformed(ActionEvent e) {
busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
}
});
idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
// connecting action tasks to status bar via TaskMonitor
TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
String propertyName = evt.getPropertyName();
if ("started".equals(propertyName)) {
if (!busyIconTimer.isRunning()) {
statusAnimationLabel.setIcon(busyIcons[0]);
busyIconIndex = 0;
busyIconTimer.start();
}
progressBar.setVisible(true);
progressBar.setIndeterminate(true);
} else if ("done".equals(propertyName)) {
busyIconTimer.stop();
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
progressBar.setValue(0);
} else if ("message".equals(propertyName)) {
String text = (String)(evt.getNewValue());
statusMessageLabel.setText((text == null) ? "" : text);
messageTimer.restart();
} else if ("progress".equals(propertyName)) {
int value = (Integer)(evt.getNewValue());
progressBar.setVisible(true);
progressBar.setIndeterminate(false);
progressBar.setValue(value);
}
}
});
}
@Action
public void showAboutBox() {
if (aboutBox == null) {
JFrame mainFrame = MarketApp.getApplication().getMainFrame();
aboutBox = new MarketAboutBox(mainFrame);
aboutBox.setLocationRelativeTo(mainFrame);
}
MarketApp.getApplication().show(aboutBox);
}
/** 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")
//
private void initComponents() {
mainPanel = new javax.swing.JPanel();
jDesktopPane1 = new javax.swing.JDesktopPane();
jToolBar1 = new javax.swing.JToolBar();
bAdmin = new javax.swing.JButton();
bBox = new javax.swing.JButton();
bBarang = new javax.swing.JButton();
bPemasok = new javax.swing.JButton();
bPelanggan = new javax.swing.JButton();
bPembelian = new javax.swing.JButton();
bPenjualan = new javax.swing.JButton();
jSeparator2 = new javax.swing.JToolBar.Separator();
lblUser = new javax.swing.JLabel();
jSeparator3 = new javax.swing.JToolBar.Separator();
lblTime = new javax.swing.JLabel();
jSeparator1 = new javax.swing.JToolBar.Separator();
menuBar = new javax.swing.JMenuBar();
javax.swing.JMenu File = new javax.swing.JMenu();
javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
javax.swing.JMenu Inventory = new javax.swing.JMenu();
menuBox = new javax.swing.JMenu();
Data = new javax.swing.JMenuItem();
TambahUang = new javax.swing.JMenuItem();
AmbilUang = new javax.swing.JMenuItem();
menuBarang = new javax.swing.JMenuItem();
jSeparator4 = new javax.swing.JPopupMenu.Separator();
menuPemasok = new javax.swing.JMenuItem();
menuPelanggan = new javax.swing.JMenuItem();
Peralatan = new javax.swing.JMenu();
menuAdmin = new javax.swing.JMenuItem();
menuBackup = new javax.swing.JMenuItem();
menuDB = new javax.swing.JMenuItem();
Transaksi = new javax.swing.JMenu();
menuPembelian = new javax.swing.JMenuItem();
menuPembayaran = new javax.swing.JMenuItem();
menuPenjualan = new javax.swing.JMenuItem();
menuPenerimaan = new javax.swing.JMenuItem();
javax.swing.JMenu helpMenu = new javax.swing.JMenu();
javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
statusPanel = new javax.swing.JPanel();
javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
statusMessageLabel = new javax.swing.JLabel();
statusAnimationLabel = new javax.swing.JLabel();
progressBar = new javax.swing.JProgressBar();
mainPanel.setName("mainPanel"); // NOI18N
mainPanel.setLayout(new java.awt.BorderLayout());
jDesktopPane1.setName("jDesktopPane1"); // NOI18N
mainPanel.add(jDesktopPane1, java.awt.BorderLayout.CENTER);
jToolBar1.setRollover(true);
jToolBar1.setName("jToolBar1"); // NOI18N
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(market.MarketApp.class).getContext().getResourceMap(MarketView.class);
bAdmin.setIcon(resourceMap.getIcon("bAdmin.icon")); // NOI18N
bAdmin.setText(resourceMap.getString("bAdmin.text")); // NOI18N
bAdmin.setFocusable(false);
bAdmin.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
bAdmin.setName("bAdmin"); // NOI18N
bAdmin.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jToolBar1.add(bAdmin);
bBox.setIcon(resourceMap.getIcon("bBox.icon")); // NOI18N
bBox.setText(resourceMap.getString("bBox.text")); // NOI18N
bBox.setFocusable(false);
bBox.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
bBox.setName("bBox"); // NOI18N
bBox.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jToolBar1.add(bBox);
bBarang.setIcon(resourceMap.getIcon("bBarang.icon")); // NOI18N
bBarang.setText(resourceMap.getString("bBarang.text")); // NOI18N
bBarang.setFocusable(false);
bBarang.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
bBarang.setName("bBarang"); // NOI18N
bBarang.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jToolBar1.add(bBarang);
bPemasok.setIcon(resourceMap.getIcon("bPemasok.icon")); // NOI18N
bPemasok.setText(resourceMap.getString("bPemasok.text")); // NOI18N
bPemasok.setFocusable(false);
bPemasok.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
bPemasok.setName("bPemasok"); // NOI18N
bPemasok.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jToolBar1.add(bPemasok);
bPelanggan.setIcon(resourceMap.getIcon("bPelanggan.icon")); // NOI18N
bPelanggan.setText(resourceMap.getString("bPelanggan.text")); // NOI18N
bPelanggan.setFocusable(false);
bPelanggan.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
bPelanggan.setName("bPelanggan"); // NOI18N
bPelanggan.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jToolBar1.add(bPelanggan);
bPembelian.setIcon(resourceMap.getIcon("bPembelian.icon")); // NOI18N
bPembelian.setText(resourceMap.getString("bPembelian.text")); // NOI18N
bPembelian.setFocusable(false);
bPembelian.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
bPembelian.setName("bPembelian"); // NOI18N
bPembelian.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jToolBar1.add(bPembelian);
bPenjualan.setIcon(resourceMap.getIcon("bPenjualan.icon")); // NOI18N
bPenjualan.setText(resourceMap.getString("bPenjualan.text")); // NOI18N
bPenjualan.setFocusable(false);
bPenjualan.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
bPenjualan.setName("bPenjualan"); // NOI18N
bPenjualan.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jToolBar1.add(bPenjualan);
jSeparator2.setName("jSeparator2"); // NOI18N
jToolBar1.add(jSeparator2);
lblUser.setText(resourceMap.getString("lblUser.text")); // NOI18N
lblUser.setName("lblUser"); // NOI18N
jToolBar1.add(lblUser);
jSeparator3.setName("jSeparator3"); // NOI18N
jToolBar1.add(jSeparator3);
lblTime.setText(resourceMap.getString("lblTime.text")); // NOI18N
lblTime.setName("lblTime"); // NOI18N
jToolBar1.add(lblTime);
jSeparator1.setName("jSeparator1"); // NOI18N
jToolBar1.add(jSeparator1);
mainPanel.add(jToolBar1, java.awt.BorderLayout.PAGE_START);
menuBar.setName("menuBar"); // NOI18N
File.setText(resourceMap.getString("File.text")); // NOI18N
File.setName("File"); // NOI18N
javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(market.MarketApp.class).getContext().getActionMap(MarketView.class, this);
exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
exitMenuItem.setName("exitMenuItem"); // NOI18N
File.add(exitMenuItem);
menuBar.add(File);
Inventory.setIcon(resourceMap.getIcon("Inventory.icon")); // NOI18N
Inventory.setText(resourceMap.getString("Inventory.text")); // NOI18N
Inventory.setName("Inventory"); // NOI18N
menuBox.setText(resourceMap.getString("menuBox.text")); // NOI18N
menuBox.setAlignmentX(0.9F);
menuBox.setAlignmentY(0.9F);
menuBox.setName("menuBox"); // NOI18N
Data.setText(resourceMap.getString("Data.text")); // NOI18N
Data.setName("Data"); // NOI18N
menuBox.add(Data);
TambahUang.setText(resourceMap.getString("TambahUang.text")); // NOI18N
TambahUang.setName("TambahUang"); // NOI18N
menuBox.add(TambahUang);
AmbilUang.setText(resourceMap.getString("AmbilUang.text")); // NOI18N
AmbilUang.setName("AmbilUang"); // NOI18N
menuBox.add(AmbilUang);
Inventory.add(menuBox);
menuBarang.setText(resourceMap.getString("menuBarang.text")); // NOI18N
menuBarang.setName("menuBarang"); // NOI18N
Inventory.add(menuBarang);
jSeparator4.setName("jSeparator4"); // NOI18N
Inventory.add(jSeparator4);
menuPemasok.setText(resourceMap.getString("menuPemasok.text")); // NOI18N
menuPemasok.setName("menuPemasok"); // NOI18N
Inventory.add(menuPemasok);
menuPelanggan.setText(resourceMap.getString("menuPelanggan.text")); // NOI18N
menuPelanggan.setName("menuPelanggan"); // NOI18N
Inventory.add(menuPelanggan);
menuBar.add(Inventory);
Peralatan.setIcon(resourceMap.getIcon("Peralatan.icon")); // NOI18N
Peralatan.setText(resourceMap.getString("Peralatan.text")); // NOI18N
Peralatan.setName("Peralatan"); // NOI18N
menuAdmin.setText(resourceMap.getString("menuAdmin.text")); // NOI18N
menuAdmin.setName("menuAdmin"); // NOI18N
Peralatan.add(menuAdmin);
menuBackup.setText(resourceMap.getString("menuBackup.text")); // NOI18N
menuBackup.setName("menuBackup"); // NOI18N
Peralatan.add(menuBackup);
menuDB.setText(resourceMap.getString("menuDB.text")); // NOI18N
menuDB.setName("menuDB"); // NOI18N
Peralatan.add(menuDB);
menuBar.add(Peralatan);
Transaksi.setIcon(resourceMap.getIcon("Transaksi.icon")); // NOI18N
Transaksi.setText(resourceMap.getString("Transaksi.text")); // NOI18N
Transaksi.setName("Transaksi"); // NOI18N
menuPembelian.setText(resourceMap.getString("menuPembelian.text")); // NOI18N
menuPembelian.setName("menuPembelian"); // NOI18N
Transaksi.add(menuPembelian);
menuPembayaran.setText(resourceMap.getString("menuPembayaran.text")); // NOI18N
menuPembayaran.setName("menuPembayaran"); // NOI18N
Transaksi.add(menuPembayaran);
menuPenjualan.setText(resourceMap.getString("menuPenjualan.text")); // NOI18N
menuPenjualan.setName("menuPenjualan"); // NOI18N
Transaksi.add(menuPenjualan);
menuPenerimaan.setText(resourceMap.getString("menuPenerimaan.text")); // NOI18N
menuPenerimaan.setName("menuPenerimaan"); // NOI18N
Transaksi.add(menuPenerimaan);
menuBar.add(Transaksi);
helpMenu.setIcon(resourceMap.getIcon("helpMenu.icon")); // NOI18N
helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
helpMenu.setName("helpMenu"); // NOI18N
aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
aboutMenuItem.setName("aboutMenuItem"); // NOI18N
helpMenu.add(aboutMenuItem);
menuBar.add(helpMenu);
statusPanel.setName("statusPanel"); // NOI18N
statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N
statusMessageLabel.setName("statusMessageLabel"); // NOI18N
statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N
progressBar.setName("progressBar"); // NOI18N
javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
statusPanel.setLayout(statusPanelLayout);
statusPanelLayout.setHorizontalGroup(
statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 522, Short.MAX_VALUE)
.addGroup(statusPanelLayout.createSequentialGroup()
.addContainerGap()
.addComponent(statusMessageLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 352, Short.MAX_VALUE)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(statusAnimationLabel)
.addContainerGap())
);
statusPanelLayout.setVerticalGroup(
statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(statusPanelLayout.createSequentialGroup()
.addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(statusMessageLabel)
.addComponent(statusAnimationLabel)
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(3, 3, 3))
);
setComponent(mainPanel);
setMenuBar(menuBar);
setStatusBar(statusPanel);
}//
// Variables declaration - do not modify
private javax.swing.JMenuItem AmbilUang;
private javax.swing.JMenuItem Data;
private javax.swing.JMenu Peralatan;
private javax.swing.JMenuItem TambahUang;
private javax.swing.JMenu Transaksi;
private javax.swing.JButton bAdmin;
private javax.swing.JButton bBarang;
private javax.swing.JButton bBox;
private javax.swing.JButton bPelanggan;
private javax.swing.JButton bPemasok;
private javax.swing.JButton bPembelian;
private javax.swing.JButton bPenjualan;
private javax.swing.JDesktopPane jDesktopPane1;
private javax.swing.JToolBar.Separator jSeparator1;
private javax.swing.JToolBar.Separator jSeparator2;
private javax.swing.JToolBar.Separator jSeparator3;
private javax.swing.JPopupMenu.Separator jSeparator4;
private javax.swing.JToolBar jToolBar1;
private javax.swing.JLabel lblTime;
private javax.swing.JLabel lblUser;
private javax.swing.JPanel mainPanel;
private javax.swing.JMenuItem menuAdmin;
private javax.swing.JMenuItem menuBackup;
private javax.swing.JMenuBar menuBar;
private javax.swing.JMenuItem menuBarang;
private javax.swing.JMenu menuBox;
private javax.swing.JMenuItem menuDB;
private javax.swing.JMenuItem menuPelanggan;
private javax.swing.JMenuItem menuPemasok;
private javax.swing.JMenuItem menuPembayaran;
private javax.swing.JMenuItem menuPembelian;
private javax.swing.JMenuItem menuPenerimaan;
private javax.swing.JMenuItem menuPenjualan;
private javax.swing.JProgressBar progressBar;
private javax.swing.JLabel statusAnimationLabel;
private javax.swing.JLabel statusMessageLabel;
private javax.swing.JPanel statusPanel;
// End of variables declaration
private final Timer messageTimer;
private final Timer busyIconTimer;
private final Icon idleIcon;
private final Icon[] busyIcons = new Icon[15];
private int busyIconIndex = 0;
private JDialog aboutBox;
}
----------------------------------------------------------------------------------------------------------
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package model;
/**
*
* @author LOBSTER
*/
public class CheckBoxNode {
String text;
boolean selected;
public CheckBoxNode (String text, boolean selected){
this.text =text;
this.selected= selected;
}
public boolean isSelected () {
return selected;
}
public void setSelected(boolean newValue) {
selected=newValue;
}
public String getText (){
return text;
}
public void setText (String newValue) {
text=newValue;
}
@Override
public String toString () {
return getClass().getName()+"["+ text+"/"+selected+"]";
}
}
---------------------------------------------------------------------------------------------------------
No comments:
Post a Comment