achmad.rifai.admin.ui.tracks.Loge.java Source code

Java tutorial

Introduction

Here is the source code for achmad.rifai.admin.ui.tracks.Loge.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package achmad.rifai.admin.ui.tracks;

import org.joda.time.DateTimeZone;

/**
 *
 * @author ai
 */
public class Loge extends javax.swing.JInternalFrame {

    /**
     * Creates new form Loge
     */
    public Loge() {
        initComponents();
    }

    /**
     * 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")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jam = new javax.swing.JSpinner();
        jScrollPane1 = new javax.swing.JScrollPane();
        aksi = new javax.swing.JTextArea();

        setClosable(true);

        jLabel1.setText("Jam");

        jLabel2.setText("Aksi");

        jam.setModel(new javax.swing.SpinnerDateModel(new java.util.Date(), null, new java.util.Date(),
                java.util.Calendar.MINUTE));

        aksi.setColumns(20);
        aksi.setRows(5);
        jScrollPane1.setViewportView(aksi);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup().addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel1).addComponent(jLabel2))
                        .addGap(37, 37, 37)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jam, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
        layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup().addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel1).addComponent(jam, javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel2).addComponent(jScrollPane1,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextArea aksi;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSpinner jam;
    // End of variables declaration//GEN-END:variables

    public void setWaktu(org.joda.time.DateTime d) {
        java.util.Date tgl = d.toDate();
        jam.setValue(jam);
    }

    public void setAksei(String s) {
        aksi.setText(s);
    }

    public achmad.rifai.erp1.entity.Jejak genJejak() {
        achmad.rifai.erp1.entity.Jejak j = new achmad.rifai.erp1.entity.Jejak();
        j.setAksi(aksi.getText());
        java.util.Date tgl = (java.util.Date) jam.getValue();
        org.joda.time.DateTime d = new org.joda.time.DateTime(tgl.getTime(), DateTimeZone.getDefault());
        j.setWaktu(d);
        return j;
    }
}