Coding · Java · Task

Helper A! – Aplikasi Simple Berbasis Java

Hai ~

Saya baru nulis blog lagi nih, yang kemarin-kemarin saya bahas tentang Dunia Fiksi… Sekarang saya akan bahas yang materinya agak berat (dikit). Yup! Sesuai judulnya kini saya akan membagikan tutorial+screenshot (design/applikasi)+full source code-nya! Kuy! Gak usah lama-lama kita langsung bahas aja aplikasinya ~

***

Deskripsi Singkat:

Herper A! atau Aplikasi Helper A! (A-nya diambil dari nama saya hehe) adalah aplikasi bantuan pekerjaan sederhana seperti menghitung karakter, konversi bilangan, konversi tanggal/waktu, mengacak angka/daftar, konversi mata uang, cek domain, cek alamat email dan masih banyak lagi. Disini saya terinspirasi dari Simple App berbasis web, dan saya mencoba membuat aplikasi-aplikasi tersebut ke java.

Aplikasi Helper yang saya buat saat ini (yang lainnya upcoming hehe) meliputi:
– Character Count (Aplikasi Hitung Karakter)
– Number Conversion (Aplikasi Konversi Bilangan)
– DateTime Conversion (Aplikasi Konversi Tanggal/Waktu)
– Random (Aplikasi Acak Nomor atau Daftar)

Berikut juga ada penjelasan singkat (lagi) untuk tiap alur aplikasi-aplikasi kecil ini:

  1. Pertama, user akan dihadapkan dengan tampilan utama (Main Welcome). Disana ada 4 tombol, yang dimana masing-masing tombol bertuliskan nama aplikasi kecil yang saya sebutkan tadi.
  2. Jika User memilih tombol “CharCount A!” mereka akan pindah ke panel      CharCount. Disini user bisa mengetik ataupun mem-paste karakter yang ingin dihitung ke kolom input yang disediakan. Klik tombol “Hitung”, setelah itu disebelah kanan kolom input akan muncul keluaran/jumlah hasil hitung karakter, kata, kalimat, paragraf dan kata yang mirip.
  3. Selanjutnya, jika user memilih tombol “NumConv. A!” , user akan dihadapkan dengan tampilan berisi: Pilih tipe konversi bilangan dan input bilangan. Setelah isi data dan mengklik tombol “KONVERSIKAN” akan muncul keluaran hasil konversi bilangan terpilih. Misal tipe yang di konversi : Biner, bilangan biner yang di input akan di konversi ke Desimal, Oktal dan Hexadesimal.
  4. Lalu ketika user memilih tombol “DateTime Conv. A!”. Dihalaman ini user harus memilih tipe konversi (dateTime -> timestamp atau timestamp -> dateTime) dan menginput data yang ingin di konversi. Klik tombol “KONVERSIKAN” hasil konversi akan muncul dibawah halaman.
  5. Dan yang terakhir, ketika user memilih tombol “Random A!”, user harus memilih tipe keluaran yang ingin ditampilkan terlebih dahulu berupa: Satuan atau Daftar. Dan user harus mengetik ataupun mempaste daftar yang ingin di acak. CATATAN: Dengan mengenter kata/kalimat akan dihitung sebagai baris/data baru dalam daftar. Klik tombol “ACAK” sistem akan mengeluarkan hasil acakan dari data yang diinput tadi, tipe keluarannya sesuai yang dipilih satuan/daftar.

 

Flowchart:
Berikut flowchart aplikasi ini:

flowchart

Gambar 1. Flowchart Helper A!

 

Design
Berikut juga screenshot design aplikasi yang saya buat dari java ini:

design_welcomeGambar 2.1. Welcome Panel

design_panel_charCountGambar 2.2. Character Count Panel

design_panel_numConversionGambar 2.3. Number Conversion Panel

design_panel_dateConversionGambar 2.4. DateTime Conversion Panel

design_panel_randomGambar 2.5. Random Panel

 

Screenshot App

Berikut adalah kumpulan screenshot ketika aplikasi sedang dijalankan:

display_2_panelCharCountGambar 3.1. Aplikasi Character Count

display_3_panelNumConv
Gambar 3.2. Aplikasi Number Conversion

display_4_panelDateConv
Gambar 3.3. Aplikasi DateTime Conversion

display_5_panelRandom
Gambar 3.4. Aplikasi Acak

 

Source Code
Dibawah ada FULL Source code-nya silahkan di copy gan!

/*
 * 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 uts;
import java.awt.Component;
import java.util.ArrayList;
import java.util.Random;
import java.awt.Dimension;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import java.util.regex.*;
import javax.swing.JOptionPane;

/**
 *
 * @author Administrator
 */
public class helper_b extends javax.swing.JFrame {

/**
 * Creates new form helper_b
 */
 public helper_b() {
 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"> 
 private void initComponents() {

welcomePanel = new javax.swing.JPanel();
 charCountPanel = new javax.swing.JPanel();
 jLabel4 = new javax.swing.JLabel();
 jLabel5 = new javax.swing.JLabel();
 jLabel6 = new javax.swing.JLabel();
 jScrollPane1 = new javax.swing.JScrollPane();
 cc_input = new javax.swing.JTextArea();
 jLabel7 = new javax.swing.JLabel();
 jPanel1 = new javax.swing.JPanel();
 jLabel8 = new javax.swing.JLabel();
 jLabel11 = new javax.swing.JLabel();
 cc_csetence = new javax.swing.JLabel();
 cc_cchar = new javax.swing.JLabel();
 cc_cparagraph = new javax.swing.JLabel();
 jLabel12 = new javax.swing.JLabel();
 jLabel13 = new javax.swing.JLabel();
 cc_cword = new javax.swing.JLabel();
 jLabel15 = new javax.swing.JLabel();
 jScrollPane3 = new javax.swing.JScrollPane();
 cc_similar1 = new javax.swing.JTextPane();
 jScrollPane4 = new javax.swing.JScrollPane();
 cc_similar2 = new javax.swing.JTextPane();
 cc_reset = new javax.swing.JButton();
 cc_submit = new javax.swing.JButton();
 numConvPanel = new javax.swing.JPanel();
 jLabel9 = new javax.swing.JLabel();
 jLabel10 = new javax.swing.JLabel();
 jLabel14 = new javax.swing.JLabel();
 jLabel16 = new javax.swing.JLabel();
 nconv_itype = new javax.swing.JComboBox<>();
 jLabel17 = new javax.swing.JLabel();
 nconv_btnclear = new javax.swing.JButton();
 nconv_btnconv = new javax.swing.JButton();
 jScrollPane2 = new javax.swing.JScrollPane();
 nconv_oconv = new javax.swing.JTextPane();
 nconv_inum = new javax.swing.JTextField();
 nconv_ltype = new javax.swing.JLabel();
 dateConvPanel = new javax.swing.JPanel();
 jLabel18 = new javax.swing.JLabel();
 jLabel19 = new javax.swing.JLabel();
 jLabel20 = new javax.swing.JLabel();
 jLabel21 = new javax.swing.JLabel();
 dconv_itype1 = new javax.swing.JComboBox<>();
 dconv_btnconv = new javax.swing.JButton();
 dconv_btnclear = new javax.swing.JButton();
 jScrollPane5 = new javax.swing.JScrollPane();
 dconv_oconv = new javax.swing.JTextPane();
 dconv_datePanel = new javax.swing.JPanel();
 jLabel22 = new javax.swing.JLabel();
 dconv_idyear = new javax.swing.JTextField();
 dconv_idmonth = new javax.swing.JComboBox<>();
 dconv_idday = new javax.swing.JComboBox<>();
 dconv_timePanel = new javax.swing.JPanel();
 jLabel23 = new javax.swing.JLabel();
 dconv_itimestamp = new javax.swing.JTextField();
 randomPanel = new javax.swing.JPanel();
 jLabel26 = new javax.swing.JLabel();
 jLabel27 = new javax.swing.JLabel();
 jLabel28 = new javax.swing.JLabel();
 jLabel29 = new javax.swing.JLabel();
 rand_itype = new javax.swing.JComboBox<>();
 jLabel30 = new javax.swing.JLabel();
 jScrollPane6 = new javax.swing.JScrollPane();
 rand_ilist = new javax.swing.JTextArea();
 rand_btnrandom = new javax.swing.JButton();
 rand_btnclear = new javax.swing.JButton();
 jScrollPane7 = new javax.swing.JScrollPane();
 rand_olist = new javax.swing.JTextPane();
 jLabel1 = new javax.swing.JLabel();
 jLabel2 = new javax.swing.JLabel();
 jLabel3 = new javax.swing.JLabel();
 showDateConv = new javax.swing.JButton();
 showCharCount = new javax.swing.JButton();
 showNumConv = new javax.swing.JButton();
 showRandom = new javax.swing.JButton();

javax.swing.GroupLayout welcomePanelLayout = new javax.swing.GroupLayout(welcomePanel);
 welcomePanel.setLayout(welcomePanelLayout);
 welcomePanelLayout.setHorizontalGroup(
 welcomePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGap(0, 100, Short.MAX_VALUE)
 );
 welcomePanelLayout.setVerticalGroup(
 welcomePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGap(0, 100, Short.MAX_VALUE)
 );

charCountPanel.setAutoscrolls(true);

jLabel4.setFont(new java.awt.Font("Cataneo BT", 1, 36)); // NOI18N
 jLabel4.setText("CharCount");

jLabel5.setFont(new java.awt.Font("Cataneo BT", 1, 48)); // NOI18N
 jLabel5.setText("A!");

jLabel6.setFont(new java.awt.Font("Century Gothic", 0, 18)); // NOI18N
 jLabel6.setText("Helper A!");
 jLabel6.setToolTipText("");

cc_input.setColumns(20);
 cc_input.setLineWrap(true);
 cc_input.setRows(5);
 cc_input.setWrapStyleWord(true);
 jScrollPane1.setViewportView(cc_input);

jLabel7.setFont(new java.awt.Font("Century Gothic", 0, 14)); // NOI18N
 jLabel7.setText("Paste-kan huruf atau kalimat yang ingin Anda hitung dibawah ini:");

jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

jLabel8.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 jLabel8.setText("Jumlah Karakter:");

jLabel11.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 jLabel11.setText("Jumlah Kalimat:");

cc_csetence.setBackground(new java.awt.Color(255, 255, 255));
 cc_csetence.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 cc_csetence.setOpaque(true);

cc_cchar.setBackground(new java.awt.Color(255, 255, 255));
 cc_cchar.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 cc_cchar.setOpaque(true);

cc_cparagraph.setBackground(new java.awt.Color(255, 255, 255));
 cc_cparagraph.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 cc_cparagraph.setOpaque(true);

jLabel12.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 jLabel12.setText("Jumlah Paragraf:");

jLabel13.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 jLabel13.setText("Jumlah Kata:");

cc_cword.setBackground(new java.awt.Color(255, 255, 255));
 cc_cword.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 cc_cword.setOpaque(true);

jLabel15.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 jLabel15.setText("Jumlah Kata Yang Mirip:");

cc_similar1.setEditable(false);
 jScrollPane3.setViewportView(cc_similar1);

cc_similar2.setEditable(false);
 jScrollPane4.setViewportView(cc_similar2);

javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
 jPanel1.setLayout(jPanel1Layout);
 jPanel1Layout.setHorizontalGroup(
 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(jPanel1Layout.createSequentialGroup()
 .addContainerGap()
 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addComponent(jLabel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 .addGroup(jPanel1Layout.createSequentialGroup()
 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
 .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
 .addComponent(cc_cchar, javax.swing.GroupLayout.DEFAULT_SIZE, 154, Short.MAX_VALUE)
 .addComponent(cc_csetence, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
 .addComponent(jLabel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
 .addComponent(cc_cword, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 .addComponent(cc_cparagraph, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addGap(0, 8, Short.MAX_VALUE))
 .addGroup(jPanel1Layout.createSequentialGroup()
 .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 281, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addComponent(jScrollPane4)))
 .addContainerGap())
 );
 jPanel1Layout.setVerticalGroup(
 jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(jPanel1Layout.createSequentialGroup()
 .addContainerGap()
 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(jPanel1Layout.createSequentialGroup()
 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addComponent(cc_cword, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addComponent(cc_cparagraph, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)))
 .addGroup(jPanel1Layout.createSequentialGroup()
 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addComponent(cc_cchar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addComponent(cc_csetence, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addComponent(jScrollPane3)
 .addComponent(jScrollPane4))
 .addContainerGap())
 );

cc_reset.setFont(new java.awt.Font("Century Gothic", 0, 14)); // NOI18N
 cc_reset.setText("Bersih");
 cc_reset.addActionListener(new java.awt.event.ActionListener() {
 public void actionPerformed(java.awt.event.ActionEvent evt) {
 cc_resetActionPerformed(evt);
 }
 });

cc_submit.setFont(new java.awt.Font("Century Gothic", 0, 14)); // NOI18N
 cc_submit.setText("HITUNG KARAKTER");
 cc_submit.addActionListener(new java.awt.event.ActionListener() {
 public void actionPerformed(java.awt.event.ActionEvent evt) {
 cc_submitActionPerformed(evt);
 }
 });

javax.swing.GroupLayout charCountPanelLayout = new javax.swing.GroupLayout(charCountPanel);
 charCountPanel.setLayout(charCountPanelLayout);
 charCountPanelLayout.setHorizontalGroup(
 charCountPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(charCountPanelLayout.createSequentialGroup()
 .addGap(18, 18, 18)
 .addGroup(charCountPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
 .addGroup(charCountPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(charCountPanelLayout.createSequentialGroup()
 .addGap(10, 10, 10)
 .addComponent(jLabel4)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(jLabel5)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addGroup(charCountPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
 .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING)
 .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)))
 .addComponent(cc_submit, javax.swing.GroupLayout.PREFERRED_SIZE, 478, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addComponent(cc_reset, javax.swing.GroupLayout.PREFERRED_SIZE, 478, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 .addGap(23, 23, 23))
 );
 charCountPanelLayout.setVerticalGroup(
 charCountPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(charCountPanelLayout.createSequentialGroup()
 .addGroup(charCountPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(charCountPanelLayout.createSequentialGroup()
 .addGap(18, 18, 18)
 .addGroup(charCountPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addComponent(jLabel4)
 .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addComponent(jLabel7)
 .addGap(8, 8, 8)
 .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 324, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addComponent(cc_submit, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(cc_reset, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addGap(0, 0, Short.MAX_VALUE))
 .addGroup(charCountPanelLayout.createSequentialGroup()
 .addGap(21, 21, 21)
 .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
 .addContainerGap())
 );

jLabel9.setFont(new java.awt.Font("Cataneo BT", 1, 36)); // NOI18N
 jLabel9.setText("Number Conv.");

jLabel10.setFont(new java.awt.Font("Cataneo BT", 1, 48)); // NOI18N
 jLabel10.setText("A!");

jLabel14.setFont(new java.awt.Font("Century Gothic", 0, 18)); // NOI18N
 jLabel14.setText("Helper A!");
 jLabel14.setToolTipText("");

jLabel16.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 jLabel16.setText("Dari Tipe Bilangan:");

nconv_itype.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Desimal", "Biner", "Oktal", "Hexadesimal" }));
 nconv_itype.addItemListener(new java.awt.event.ItemListener() {
 public void itemStateChanged(java.awt.event.ItemEvent evt) {
 nconv_itypeItemStateChanged(evt);
 }
 });

jLabel17.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 jLabel17.setText("Dari Bilangan:");

nconv_btnclear.setText("Bersih");
 nconv_btnclear.addActionListener(new java.awt.event.ActionListener() {
 public void actionPerformed(java.awt.event.ActionEvent evt) {
 nconv_btnclearActionPerformed(evt);
 }
 });

nconv_btnconv.setText("KONVERSIKAN");
 nconv_btnconv.addActionListener(new java.awt.event.ActionListener() {
 public void actionPerformed(java.awt.event.ActionEvent evt) {
 nconv_btnconvActionPerformed(evt);
 }
 });

nconv_oconv.setEditable(false);
 nconv_oconv.setBackground(new java.awt.Color(238, 238, 238));
 nconv_oconv.setFont(new java.awt.Font("Century Gothic", 0, 14)); // NOI18N
 jScrollPane2.setViewportView(nconv_oconv);

nconv_ltype.setText("()");

javax.swing.GroupLayout numConvPanelLayout = new javax.swing.GroupLayout(numConvPanel);
 numConvPanel.setLayout(numConvPanelLayout);
 numConvPanelLayout.setHorizontalGroup(
 numConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(numConvPanelLayout.createSequentialGroup()
 .addGap(20, 20, 20)
 .addGroup(numConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
 .addComponent(jScrollPane2)
 .addGroup(numConvPanelLayout.createSequentialGroup()
 .addComponent(jLabel9)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(jLabel10)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(jLabel14, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE))
 .addGroup(numConvPanelLayout.createSequentialGroup()
 .addGroup(numConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
 .addGroup(numConvPanelLayout.createSequentialGroup()
 .addComponent(jLabel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(nconv_ltype)
 .addGap(17, 17, 17))
 .addComponent(jLabel16, javax.swing.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addGroup(numConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, numConvPanelLayout.createSequentialGroup()
 .addComponent(nconv_btnclear, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(nconv_btnconv, javax.swing.GroupLayout.DEFAULT_SIZE, 128, Short.MAX_VALUE))
 .addComponent(nconv_itype, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 .addComponent(nconv_inum, javax.swing.GroupLayout.Alignment.LEADING))))
 .addContainerGap(12, Short.MAX_VALUE))
 );
 numConvPanelLayout.setVerticalGroup(
 numConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(numConvPanelLayout.createSequentialGroup()
 .addContainerGap()
 .addGroup(numConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addComponent(jLabel9)
 .addComponent(jLabel14, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addGap(18, 18, 18)
 .addGroup(numConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
 .addComponent(nconv_itype, javax.swing.GroupLayout.DEFAULT_SIZE, 33, Short.MAX_VALUE)
 .addComponent(jLabel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addGroup(numConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(numConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 .addComponent(jLabel17, javax.swing.GroupLayout.DEFAULT_SIZE, 37, Short.MAX_VALUE)
 .addComponent(nconv_ltype))
 .addComponent(nconv_inum))
 .addGap(18, 18, 18)
 .addGroup(numConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 .addComponent(nconv_btnconv, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addComponent(nconv_btnclear, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addContainerGap())
 );

jLabel18.setFont(new java.awt.Font("Cataneo BT", 1, 36)); // NOI18N
 jLabel18.setText("DateTime Conv.");

jLabel19.setFont(new java.awt.Font("Cataneo BT", 1, 48)); // NOI18N
 jLabel19.setText("A!");

jLabel20.setFont(new java.awt.Font("Century Gothic", 0, 18)); // NOI18N
 jLabel20.setText("Helper A!");
 jLabel20.setToolTipText("");

jLabel21.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 jLabel21.setText("Tipe Konversi:");

dconv_itype1.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "DateTime to Timestamp", "Timestamp to DateTime" }));
 dconv_itype1.addItemListener(new java.awt.event.ItemListener() {
 public void itemStateChanged(java.awt.event.ItemEvent evt) {
 dconv_itype1ItemStateChanged(evt);
 }
 });

dconv_btnconv.setText("KONVERSIKAN");
 dconv_btnconv.addActionListener(new java.awt.event.ActionListener() {
 public void actionPerformed(java.awt.event.ActionEvent evt) {
 dconv_btnconvActionPerformed(evt);
 }
 });

dconv_btnclear.setText("Bersih");
 dconv_btnclear.addActionListener(new java.awt.event.ActionListener() {
 public void actionPerformed(java.awt.event.ActionEvent evt) {
 dconv_btnclearActionPerformed(evt);
 }
 });

dconv_oconv.setEditable(false);
 dconv_oconv.setBackground(new java.awt.Color(238, 238, 238));
 dconv_oconv.setFont(new java.awt.Font("Century Gothic", 0, 14)); // NOI18N
 jScrollPane5.setViewportView(dconv_oconv);

jLabel22.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 jLabel22.setText("Tanggal (dd/mm/yyyy): ");

dconv_idyear.addKeyListener(new java.awt.event.KeyAdapter() {
 public void keyTyped(java.awt.event.KeyEvent evt) {
 dconv_idyearKeyTyped(evt);
 }
 });

dconv_idmonth.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }));

dconv_idday.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "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" }));

javax.swing.GroupLayout dconv_datePanelLayout = new javax.swing.GroupLayout(dconv_datePanel);
 dconv_datePanel.setLayout(dconv_datePanelLayout);
 dconv_datePanelLayout.setHorizontalGroup(
 dconv_datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(dconv_datePanelLayout.createSequentialGroup()
 .addGap(0, 0, 0)
 .addComponent(jLabel22)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(dconv_idday, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addGap(7, 7, 7)
 .addComponent(dconv_idmonth, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(dconv_idyear)
 .addGap(0, 0, 0))
 );
 dconv_datePanelLayout.setVerticalGroup(
 dconv_datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(dconv_datePanelLayout.createSequentialGroup()
 .addContainerGap()
 .addGroup(dconv_datePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
 .addComponent(dconv_idday, javax.swing.GroupLayout.DEFAULT_SIZE, 33, Short.MAX_VALUE)
 .addComponent(jLabel22, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 .addComponent(dconv_idmonth)
 .addComponent(dconv_idyear))
 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 );

jLabel23.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 jLabel23.setText("Timestamp:");

javax.swing.GroupLayout dconv_timePanelLayout = new javax.swing.GroupLayout(dconv_timePanel);
 dconv_timePanel.setLayout(dconv_timePanelLayout);
 dconv_timePanelLayout.setHorizontalGroup(
 dconv_timePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(dconv_timePanelLayout.createSequentialGroup()
 .addGap(0, 0, 0)
 .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addComponent(dconv_itimestamp, javax.swing.GroupLayout.PREFERRED_SIZE, 312, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addContainerGap())
 );
 dconv_timePanelLayout.setVerticalGroup(
 dconv_timePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(dconv_timePanelLayout.createSequentialGroup()
 .addGap(1, 1, 1)
 .addGroup(dconv_timePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
 .addComponent(dconv_itimestamp, javax.swing.GroupLayout.DEFAULT_SIZE, 33, Short.MAX_VALUE)
 .addComponent(jLabel23, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 );

javax.swing.GroupLayout dateConvPanelLayout = new javax.swing.GroupLayout(dateConvPanel);
 dateConvPanel.setLayout(dateConvPanelLayout);
 dateConvPanelLayout.setHorizontalGroup(
 dateConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dateConvPanelLayout.createSequentialGroup()
 .addGap(24, 24, 24)
 .addGroup(dateConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
 .addComponent(dconv_timePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 .addGroup(dateConvPanelLayout.createSequentialGroup()
 .addComponent(dconv_btnclear, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addComponent(dconv_btnconv, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 .addGroup(dateConvPanelLayout.createSequentialGroup()
 .addComponent(jLabel18)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addComponent(jLabel19)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addComponent(jLabel20)
 .addGap(0, 0, Short.MAX_VALUE))
 .addComponent(jScrollPane5)
 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, dateConvPanelLayout.createSequentialGroup()
 .addComponent(jLabel21, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(dconv_itype1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 .addComponent(dconv_datePanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 .addContainerGap())
 );
 dateConvPanelLayout.setVerticalGroup(
 dateConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(dateConvPanelLayout.createSequentialGroup()
 .addContainerGap()
 .addGroup(dateConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(dateConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addComponent(jLabel18))
 .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addGap(18, 18, 18)
 .addGroup(dateConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
 .addComponent(jLabel21, javax.swing.GroupLayout.DEFAULT_SIZE, 33, Short.MAX_VALUE)
 .addComponent(dconv_itype1))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(dconv_datePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 .addComponent(dconv_timePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addGroup(dateConvPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 .addComponent(dconv_btnconv, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addComponent(dconv_btnclear, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addGap(21, 21, 21))
 );

jLabel26.setFont(new java.awt.Font("Cataneo BT", 1, 36)); // NOI18N
 jLabel26.setText("Random");

jLabel27.setFont(new java.awt.Font("Cataneo BT", 1, 48)); // NOI18N
 jLabel27.setText("A!");

jLabel28.setFont(new java.awt.Font("Century Gothic", 0, 18)); // NOI18N
 jLabel28.setText("Helper A!");
 jLabel28.setToolTipText("");

jLabel29.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 jLabel29.setText("Tipe Keluaran Konversi:");

rand_itype.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Daftar", "Satuan" }));

jLabel30.setFont(new java.awt.Font("Century Gothic", 0, 12)); // NOI18N
 jLabel30.setText("Ketik atau salin daftar dibawah ini (klik enter untuk membuat daftar baru):");

rand_ilist.setColumns(20);
 rand_ilist.setRows(5);
 jScrollPane6.setViewportView(rand_ilist);

rand_btnrandom.setText("ACAK");
 rand_btnrandom.addActionListener(new java.awt.event.ActionListener() {
 public void actionPerformed(java.awt.event.ActionEvent evt) {
 rand_btnrandomActionPerformed(evt);
 }
 });

rand_btnclear.setText("Bersih");
 rand_btnclear.addActionListener(new java.awt.event.ActionListener() {
 public void actionPerformed(java.awt.event.ActionEvent evt) {
 rand_btnclearActionPerformed(evt);
 }
 });

rand_olist.setEditable(false);
 rand_olist.setBackground(new java.awt.Color(238, 238, 238));
 rand_olist.setFont(new java.awt.Font("Century Gothic", 0, 14)); // NOI18N
 jScrollPane7.setViewportView(rand_olist);

javax.swing.GroupLayout randomPanelLayout = new javax.swing.GroupLayout(randomPanel);
 randomPanel.setLayout(randomPanelLayout);
 randomPanelLayout.setHorizontalGroup(
 randomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(randomPanelLayout.createSequentialGroup()
 .addGap(18, 18, 18)
 .addGroup(randomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
 .addGroup(randomPanelLayout.createSequentialGroup()
 .addComponent(rand_btnclear, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addComponent(rand_btnrandom, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 .addComponent(jScrollPane6)
 .addGroup(randomPanelLayout.createSequentialGroup()
 .addComponent(jLabel26, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addComponent(jLabel27)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addGroup(randomPanelLayout.createSequentialGroup()
 .addComponent(jLabel29, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(rand_itype, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 .addComponent(jLabel30, javax.swing.GroupLayout.DEFAULT_SIZE, 472, Short.MAX_VALUE))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 203, Short.MAX_VALUE)
 .addContainerGap())
 );
 randomPanelLayout.setVerticalGroup(
 randomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(randomPanelLayout.createSequentialGroup()
 .addGroup(randomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(randomPanelLayout.createSequentialGroup()
 .addGap(16, 16, 16)
 .addGroup(randomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(randomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 .addComponent(jLabel26)
 .addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addComponent(jLabel28, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addGap(18, 18, 18)
 .addGroup(randomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 .addComponent(jLabel29, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addComponent(rand_itype, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addComponent(jLabel30)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
 .addGroup(randomPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 .addComponent(rand_btnrandom, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE)
 .addComponent(rand_btnclear, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE)))
 .addGroup(randomPanelLayout.createSequentialGroup()
 .addGap(19, 19, 19)
 .addComponent(jScrollPane7)))
 .addContainerGap())
 );

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
 addWindowListener(new java.awt.event.WindowAdapter() {
 public void windowActivated(java.awt.event.WindowEvent evt) {
 formWindowActivated(evt);
 }
 });

jLabel1.setFont(new java.awt.Font("Century Gothic", 0, 14)); // NOI18N
 jLabel1.setText("Helper app by Anggraeni.");
 jLabel1.setToolTipText("");

jLabel2.setFont(new java.awt.Font("Cataneo BT", 1, 36)); // NOI18N
 jLabel2.setText("Helper");

jLabel3.setFont(new java.awt.Font("Cataneo BT", 1, 48)); // NOI18N
 jLabel3.setText("A!");

showDateConv.setFont(new java.awt.Font("Century Gothic", 0, 24)); // NOI18N
 showDateConv.setText("DateTime Conv. A!");
 showDateConv.addActionListener(new java.awt.event.ActionListener() {
 public void actionPerformed(java.awt.event.ActionEvent evt) {
 showDateConvActionPerformed(evt);
 }
 });

showCharCount.setFont(new java.awt.Font("Century Gothic", 0, 24)); // NOI18N
 showCharCount.setText("CharCount A!");
 showCharCount.addActionListener(new java.awt.event.ActionListener() {
 public void actionPerformed(java.awt.event.ActionEvent evt) {
 showCharCountActionPerformed(evt);
 }
 });

showNumConv.setFont(new java.awt.Font("Century Gothic", 0, 24)); // NOI18N
 showNumConv.setText("Number Conv. A!");
 showNumConv.addActionListener(new java.awt.event.ActionListener() {
 public void actionPerformed(java.awt.event.ActionEvent evt) {
 showNumConvActionPerformed(evt);
 }
 });

showRandom.setFont(new java.awt.Font("Century Gothic", 0, 24)); // NOI18N
 showRandom.setText("Random A!");
 showRandom.addActionListener(new java.awt.event.ActionListener() {
 public void actionPerformed(java.awt.event.ActionEvent evt) {
 showRandomActionPerformed(evt);
 }
 });

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
 getContentPane().setLayout(layout);
 layout.setHorizontalGroup(
 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(layout.createSequentialGroup()
 .addGap(28, 28, 28)
 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(layout.createSequentialGroup()
 .addComponent(jLabel2)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(jLabel3)
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addGroup(layout.createSequentialGroup()
 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
 .addComponent(showDateConv, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 267, Short.MAX_VALUE)
 .addComponent(showCharCount, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
 .addComponent(showRandom, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 .addComponent(showNumConv, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 267, javax.swing.GroupLayout.PREFERRED_SIZE))))
 .addContainerGap(15, Short.MAX_VALUE))
 );
 layout.setVerticalGroup(
 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(layout.createSequentialGroup()
 .addContainerGap()
 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
 .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
 .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
 .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)))
 .addGap(25, 25, 25)
 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
 .addGroup(layout.createSequentialGroup()
 .addComponent(showCharCount, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addGap(26, 26, 26)
 .addComponent(showDateConv, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE))
 .addGroup(layout.createSequentialGroup()
 .addComponent(showNumConv, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
 .addGap(26, 26, 26)
 .addComponent(showRandom, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)))
 .addContainerGap(19, Short.MAX_VALUE))
 );

pack();
 }// </editor-fold> 
 
 void setPanelEnabled(JPanel panel, Boolean isEnabled) {
 panel.setEnabled(isEnabled);

Component[] components = panel.getComponents();

for(int i = 0; i < components.length; i++) {
 if(components[i].getClass().getName() == "javax.swing.JPanel") {
 setPanelEnabled((JPanel) components[i], isEnabled);
 }

components[i].setEnabled(isEnabled);
 }
 }


 public void setPanels(JPanel p, boolean hide){
 JFrame jframe = new JFrame();
 JPanel panel = p; 
 /*JScrollPane scrollPane = new JScrollPane(panel);
 scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
 scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
 scrollPane.setBounds(0, 0, 900, 900);
 JPanel contentPane = new JPanel(null);
 contentPane.setPreferredSize(new Dimension(900, 700));
 contentPane.add(scrollPane);*/
 jframe.setContentPane(panel);
 jframe.pack();
 jframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
 if(!hide) jframe.setVisible(true);
 else jframe.setVisible(false);
 }
 
 private void showCharCountActionPerformed(java.awt.event.ActionEvent evt) { 
 // TODO add your handling code here:
 this.setPanels(this.charCountPanel, false);
 }

private void cc_submitActionPerformed(java.awt.event.ActionEvent evt) { 
 // TODO add your handling code here:
 String inputChar = cc_input.getText();
 inputChar = inputChar.trim();
 if(inputChar == null || inputChar.isEmpty()){
 JOptionPane.showMessageDialog(null, "Input text wajib diisi!"); return;
 } 
 //hitung char
 cc_cchar.setText(""+inputChar.length());
 //hitung word
 String[] charWord = inputChar.split("\\s+");
 cc_cword.setText(""+charWord.length);
 //hitung kalimat
 String[] charSetence = inputChar.split("\\.\\s");
 cc_csetence.setText(""+charSetence.length);
 //hitung paragraf
 String[] charParag = inputChar.split("\\n");
 cc_cparagraph.setText(""+charParag.length);
 //cari kata yg sama
 ArrayList word = new ArrayList();
 ArrayList count = new ArrayList();
 for(int x=0; x < charWord.length; x++){
 String value = charWord[x];
 if(word.contains(value)){
 int i = word.indexOf(value);
 int c = Integer.parseInt((String) count.get(i)) + 1;
 count.set(i, String.valueOf(c));
 }else{
 word.add(value);
 count.add("1");
 }
 }
 //tampil kata yang sama
 String[] sameResult = new String[word.size()];
 for(int x=0; x < word.size(); x++){
 sameResult[x] = word.get(x)+" : "+count.get(x)+" kata";
 }
 int sln = sameResult.length;
 String[] sameA = new String[(sln%2 == 1 ? sln+1 : sln)/2];
 String[] sameB = new String[sln - sameA.length];
 
 System.arraycopy(sameResult, 0, sameA, 0, sameA.length);
 System.arraycopy(sameResult, sameA.length, sameB, 0, sameB.length);
 
 cc_similar1.setText(String.join("\n", sameA));
 cc_similar2.setText(String.join("\n", sameB));
 }

private void cc_resetActionPerformed(java.awt.event.ActionEvent evt) { 
 // TODO add your handling code here:
 cc_input.setText("");
 cc_cchar.setText("");
 cc_cword.setText("");
 cc_csetence.setText("");
 cc_cparagraph.setText("");
 cc_similar1.setText("");
 cc_similar2.setText("");
 }

private void showNumConvActionPerformed(java.awt.event.ActionEvent evt) { 
 // TODO add your handling code here:
 this.setPanels(this.numConvPanel, false);
 }

private void showDateConvActionPerformed(java.awt.event.ActionEvent evt) { 
 // TODO add your handling code here:
 this.setPanels(this.dateConvPanel, false);
 }

private void showRandomActionPerformed(java.awt.event.ActionEvent evt) { 
 // TODO add your handling code here:
 this.setPanels(this.randomPanel, false);
 }

private void rand_btnrandomActionPerformed(java.awt.event.ActionEvent evt) { 
 // TODO add your handling code here:
 int type = rand_itype.getSelectedIndex();
 String[] input = rand_ilist.getText().split("\\n");
 
 if(type == 0){
 ArrayList random = new ArrayList();
 for(int x=0; x<input.length; x++){;
 random.add(input[x]);
 }
 Collections.shuffle(random);
 rand_olist.setText(String.join("\n", random));
 }else{
 int rnd = new Random().nextInt(input.length);
 rand_olist.setText(String.join("\n", input[rnd]));
 }
 }

private void rand_btnclearActionPerformed(java.awt.event.ActionEvent evt) { 
 // TODO add your handling code here:
 this.rand_ilist.setText("");
 this.rand_olist.setText("");
 }

private void formWindowActivated(java.awt.event.WindowEvent evt) { 
 // TODO add your handling code here
 this.setPanelEnabled(this.dconv_timePanel, false);
 }

private void dconv_itype1ItemStateChanged(java.awt.event.ItemEvent evt) { 
 // TODO add your handling code here:
 if(dconv_itype1.getSelectedIndex() == 0){
 this.setPanelEnabled(this.dconv_timePanel, false);
 this.setPanelEnabled(this.dconv_datePanel, true);
 }else{
 this.setPanelEnabled(this.dconv_timePanel, true);
 this.setPanelEnabled(this.dconv_datePanel, false);
 }
 }

private void dconv_idyearKeyTyped(java.awt.event.KeyEvent evt) { 
 // TODO add your handling code here:
 if(dconv_idyear.getText().length()>=4) { 
 evt.consume();
 }
 }

private void dconv_btnconvActionPerformed(java.awt.event.ActionEvent evt) { 
 // TODO add your handling code here:
 if(dconv_itype1.getSelectedIndex() == 0){
 if(dconv_idyear.getText() == null || dconv_idyear.getText().isEmpty()){
 JOptionPane.showMessageDialog(null, "Input tahun wajib diisi: 4 karakter!"); return;
 }
 String day = String.valueOf(dconv_idday.getSelectedIndex()+1);
 String month = (String)dconv_idmonth.getSelectedItem();
 String date = day+"/"+month+"/"+dconv_idyear.getText(); 
 Date dateConv = null;
 try {
 dateConv = new SimpleDateFormat("dd/MMM/yyyy").parse(date);
 long unix = dateConv.getTime() / 1000;
 dconv_oconv.setText(""+unix);
 } catch (ParseException ex) {
 Logger.getLogger(helper_b.class.getName()).log(Level.SEVERE, null, ex);
 }
 }else{
 if(dconv_itimestamp.getText() == null || dconv_itimestamp.getText().isEmpty()){
 JOptionPane.showMessageDialog(null, "Input timestamp wajib diisi: 4 karakter!"); return;
 }
 long unix = Long.parseLong(dconv_itimestamp.getText()) * 1000;
 Date dateConv = new Date(unix);
 dconv_oconv.setText(""+dateConv.toString());
 } 
 }

private void dconv_btnclearActionPerformed(java.awt.event.ActionEvent evt) { 
 // TODO add your handling code here:
 this.dconv_oconv.setText("");
 this.dconv_itimestamp.setText("");
 this.dconv_idyear.setText("");
 }

private void nconv_btnconvActionPerformed(java.awt.event.ActionEvent evt) { 
 // TODO add your handling code here:
 if(nconv_inum.getText() == null || nconv_inum.getText().isEmpty()){
 JOptionPane.showMessageDialog(null, "Input text wajib diisi: 4 karakter!"); return;
 }
 if(nconv_itype.getSelectedIndex() == 0){
 //desimal -> all
 try{
 int decimal = Integer.parseInt(nconv_inum.getText());
 String toBiner = Integer.toString(decimal, 2);
 String toOktal = Integer.toString(decimal, 8);
 String toHexa = Integer.toString(decimal, 16);

nconv_oconv.setText("Biner : "+toBiner+"\nOktal : "+toOktal+"\nHexadesimal : "+toHexa);
 }catch(NumberFormatException e){
 JOptionPane.showMessageDialog(null, "Input format bilangan dengan benar."); return;
 }
 }else if(nconv_itype.getSelectedIndex() == 1){
 //biner -> all
 String biner = nconv_inum.getText();
 try{
 int decimal = Integer.parseInt(biner, 2);
 String toDesimal = String.valueOf(decimal);
 String toOktal = Integer.toString(decimal, 8);
 String toHexa = Integer.toString(decimal, 16);

nconv_oconv.setText("Desimal : "+toDesimal+"\nOktal : "+toOktal+"\nHexadesimal : "+toHexa);
 }catch(NumberFormatException e){
 JOptionPane.showMessageDialog(null, "Input format bilangan dengan benar."); return;
 }
 }else if(nconv_itype.getSelectedIndex() == 2){
 //oktal -> all
 String oktal = nconv_inum.getText();
 try{
 int decimal = Integer.parseInt(oktal, 8);
 String toDesimal = String.valueOf(decimal);
 String toBiner = Integer.toString(decimal, 2);
 String toHexa = Integer.toString(decimal, 16);
 nconv_oconv.setText("Desimal : "+toDesimal+"\nBiner : "+toBiner+"\nHexadesimal : "+toHexa);
 }catch(NumberFormatException e){
 JOptionPane.showMessageDialog(null, "Input format bilangan dengan benar."); return;
 }
 }else{
 //hexa -> all
 String hexa = nconv_inum.getText();
 try{
 int decimal = Integer.parseInt(hexa, 16);
 String toDesimal = String.valueOf(decimal);
 String toBiner = Integer.toString(decimal, 2);
 String toOktal = Integer.toString(decimal, 8);
 nconv_oconv.setText("Desimal : "+toDesimal+"\nBiner : "+toBiner+"\nOktal : "+toOktal);
 }catch(NumberFormatException e){
 JOptionPane.showMessageDialog(null, "Input format bilangan dengan benar."); return;
 }
 }
 }

private void nconv_btnclearActionPerformed(java.awt.event.ActionEvent evt) { 
 // TODO add your handling code here:
 nconv_oconv.setText("");
 nconv_inum.setText("");
 nconv_ltype.setText("()");
 }

private void nconv_itypeItemStateChanged(java.awt.event.ItemEvent evt) { 
 // TODO add your handling code here:
 if(nconv_itype.getSelectedIndex() == 0){ nconv_ltype.setText("(10)"); }
 else if(nconv_itype.getSelectedIndex() == 1){ nconv_ltype.setText("(2)"); }
 else if(nconv_itype.getSelectedIndex() == 2){ nconv_ltype.setText("(8)"); }
 else{ nconv_ltype.setText("(16)"); }
 }

/**
 * @param args the command line arguments
 */
 public static void main(String args[]) {
 /* Set the Nimbus look and feel */
 //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
 /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
 * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
 */
 try {
 for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
 if ("Nimbus".equals(info.getName())) {
 javax.swing.UIManager.setLookAndFeel(info.getClassName());
 break;
 }
 }
 } catch (ClassNotFoundException ex) {
 java.util.logging.Logger.getLogger(helper_b.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
 } catch (InstantiationException ex) {
 java.util.logging.Logger.getLogger(helper_b.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
 } catch (IllegalAccessException ex) {
 java.util.logging.Logger.getLogger(helper_b.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
 } catch (javax.swing.UnsupportedLookAndFeelException ex) {
 java.util.logging.Logger.getLogger(helper_b.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
 }
 //</editor-fold>

/* Create and display the form */
 java.awt.EventQueue.invokeLater(new Runnable() {
 public void run() {
 new helper_b().setVisible(true);
 }
 });
 }

// Variables declaration - do not modify 
 private javax.swing.JLabel cc_cchar;
 private javax.swing.JLabel cc_cparagraph;
 private javax.swing.JLabel cc_csetence;
 private javax.swing.JLabel cc_cword;
 private javax.swing.JTextArea cc_input;
 private javax.swing.JButton cc_reset;
 private javax.swing.JTextPane cc_similar1;
 private javax.swing.JTextPane cc_similar2;
 private javax.swing.JButton cc_submit;
 private javax.swing.JPanel charCountPanel;
 private javax.swing.JPanel dateConvPanel;
 private javax.swing.JButton dconv_btnclear;
 private javax.swing.JButton dconv_btnconv;
 private javax.swing.JPanel dconv_datePanel;
 private javax.swing.JComboBox<String> dconv_idday;
 private javax.swing.JComboBox<String> dconv_idmonth;
 private javax.swing.JTextField dconv_idyear;
 private javax.swing.JTextField dconv_itimestamp;
 private javax.swing.JComboBox<String> dconv_itype1;
 private javax.swing.JTextPane dconv_oconv;
 private javax.swing.JPanel dconv_timePanel;
 private javax.swing.JLabel jLabel1;
 private javax.swing.JLabel jLabel10;
 private javax.swing.JLabel jLabel11;
 private javax.swing.JLabel jLabel12;
 private javax.swing.JLabel jLabel13;
 private javax.swing.JLabel jLabel14;
 private javax.swing.JLabel jLabel15;
 private javax.swing.JLabel jLabel16;
 private javax.swing.JLabel jLabel17;
 private javax.swing.JLabel jLabel18;
 private javax.swing.JLabel jLabel19;
 private javax.swing.JLabel jLabel2;
 private javax.swing.JLabel jLabel20;
 private javax.swing.JLabel jLabel21;
 private javax.swing.JLabel jLabel22;
 private javax.swing.JLabel jLabel23;
 private javax.swing.JLabel jLabel26;
 private javax.swing.JLabel jLabel27;
 private javax.swing.JLabel jLabel28;
 private javax.swing.JLabel jLabel29;
 private javax.swing.JLabel jLabel3;
 private javax.swing.JLabel jLabel30;
 private javax.swing.JLabel jLabel4;
 private javax.swing.JLabel jLabel5;
 private javax.swing.JLabel jLabel6;
 private javax.swing.JLabel jLabel7;
 private javax.swing.JLabel jLabel8;
 private javax.swing.JLabel jLabel9;
 private javax.swing.JPanel jPanel1;
 private javax.swing.JScrollPane jScrollPane1;
 private javax.swing.JScrollPane jScrollPane2;
 private javax.swing.JScrollPane jScrollPane3;
 private javax.swing.JScrollPane jScrollPane4;
 private javax.swing.JScrollPane jScrollPane5;
 private javax.swing.JScrollPane jScrollPane6;
 private javax.swing.JScrollPane jScrollPane7;
 private javax.swing.JButton nconv_btnclear;
 private javax.swing.JButton nconv_btnconv;
 private javax.swing.JTextField nconv_inum;
 private javax.swing.JComboBox<String> nconv_itype;
 private javax.swing.JLabel nconv_ltype;
 private javax.swing.JTextPane nconv_oconv;
 private javax.swing.JPanel numConvPanel;
 private javax.swing.JButton rand_btnclear;
 private javax.swing.JButton rand_btnrandom;
 private javax.swing.JTextArea rand_ilist;
 private javax.swing.JComboBox<String> rand_itype;
 private javax.swing.JTextPane rand_olist;
 private javax.swing.JPanel randomPanel;
 private javax.swing.JButton showCharCount;
 private javax.swing.JButton showDateConv;
 private javax.swing.JButton showNumConv;
 private javax.swing.JButton showRandom;
 private javax.swing.JPanel welcomePanel;
 // End of variables declaration 
}

 

 

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

w

Connecting to %s