/*
* 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 examples;
import com.sun.java.swing.plaf.windows.WindowsFileChooserUI;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import javax.swing.JLabel;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileView;
import javax.swing.plaf.FileChooserUI;
/**
*
* @author hasan
*/
public class NewJFrame extends javax.swing.JFrame {
/**
* Creates new form NewJFrame
*/
public static ArrayList<JTextField> jt=new ArrayList<JTextField>();
public NewJFrame() {
initComponents();
jPanel3.setLayout(new BoxLayout(jPanel3, BoxLayout.Y_AXIS));
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
panel.add(new JLabel("Ana Parse text"));
JTextField t1 = new JTextField(15);
panel.add(t1);
JPanel panel2 = new JPanel();
panel2.setLayout(new BoxLayout(panel2, BoxLayout.X_AXIS));
panel2.add(new JLabel("2. Parse text"));
JTextField t2 = new JTextField(15);
panel2.add(t2);
JPanel panel3 = new JPanel();
panel3.setLayout(new BoxLayout(panel3, BoxLayout.X_AXIS));
panel3.add(new JLabel("3. Parse text"));
JTextField t3 = new JTextField(15);
panel3.add(t3);
JPanel panel4 = new JPanel();
panel4.setLayout(new BoxLayout(panel4, BoxLayout.X_AXIS));
panel4.add(new JLabel("4. Parse text"));
JTextField t4 = new JTextField(15);
panel4.add(t4);
JPanel panel5 = new JPanel();
panel5.setLayout(new BoxLayout(panel5, BoxLayout.X_AXIS));
panel5.add(new JLabel("5. Parse text"));
JTextField t5 = new JTextField(15);
panel5.add(t5);
JPanel panel6 = new JPanel();
panel6.setLayout(new BoxLayout(panel6, BoxLayout.X_AXIS));
panel6.add(new JLabel("6. Parse text"));
JTextField t6 = new JTextField(15);
panel6.add(t6);
JPanel panel7 = new JPanel();
panel7.setLayout(new BoxLayout(panel7, BoxLayout.X_AXIS));
panel7.add(new JLabel("7. Parse text"));
JTextField t7 = new JTextField(15);
panel7.add(t7);
//[new dua][dua ismi : Hisbü's-Seyf][dua ismi arapca :
//[dua sahibi : Hz. Ali (r.a)][dua sahibi arabic :[dua turu : ][dua metni : arabic]
t1.setText("[new dua]");
t2.setText("[dua ismi :");
t3.setText("[dua ismi arapca :");
t4.setText("[dua sahibi :");
t5.setText("[dua sahibi arabic :");
t6.setText("[dua turu :");
t7.setText("[dua metni :");
jt.add(t1);
jt.add(t2);
jt.add(t3);
jt.add(t4);
jt.add(t5);
jt.add(t6);
jt.add(t7);
jPanel3.add(panel);
jPanel3.add(panel2);
jPanel3.add(panel3);
jPanel3.add(panel4);
jPanel3.add(panel5);
jPanel3.add(panel6);
jPanel3.add(panel7);
validate();
}
/**
* 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() {
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenu2 = new javax.swing.JMenu();
jMenu3 = new javax.swing.JMenu();
jMenu4 = new javax.swing.JMenu();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
jPanel3 = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();
jPanel4 = new javax.swing.JPanel();
jCheckBox1 = new javax.swing.JCheckBox();
label9 = new java.awt.Label();
jCheckBox2 = new javax.swing.JCheckBox();
jButton3 = new javax.swing.JButton();
jTextField5 = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jTextField7 = new javax.swing.JTextField();
jComboBox1 = new javax.swing.JComboBox();
jCheckBox3 = new javax.swing.JCheckBox();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea2 = new javax.swing.JTextArea();
jLabel4 = new javax.swing.JLabel();
jComboBox2 = new javax.swing.JComboBox();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
jButton4 = new javax.swing.JButton();
jLabel8 = new javax.swing.JLabel();
jScrollPane3 = new javax.swing.JScrollPane();
jTextArea3 = new javax.swing.JTextArea();
jLabel9 = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jMenu1.setText("File");
jMenuBar1.add(jMenu1);
jMenu2.setText("Edit");
jMenuBar1.add(jMenu2);
jMenu3.setText("jMenu3");
jMenu4.setText("jMenu4");
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 497, Short.MAX_VALUE)
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 187, Short.MAX_VALUE)
);
jButton1.setText("Add");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton1)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(49, 49, 49)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(179, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 332, Short.MAX_VALUE)
.addComponent(jButton1)
.addContainerGap())
);
jTabbedPane1.addTab("Main", jPanel1);
jCheckBox1.setText("Olusturulacak Veritabani adi?");
jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox1ActionPerformed(evt);
}
});
label9.setText("Eger bir klasor secerseniz dosya adlariyla tablo olusturup bu dosyalardaki bilgileri tek tek isler");
jCheckBox2.setText("MultiThread?");
jCheckBox2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox2ActionPerformed(evt);
}
});
jButton3.setText("File&Folder Chooser");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jLabel1.setText("jLabel1");
jTextField7.setText("Tablo Adi ?");
jTextField7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField7ActionPerformed(evt);
}
});
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Thread Sayisi", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }));
jComboBox1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox1ActionPerformed(evt);
}
});
jCheckBox3.setLabel("Ayiklamada yapalimmi ?");
jCheckBox3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox3ActionPerformed(evt);
}
});
jTextArea2.setColumns(20);
jTextArea2.setRows(5);
jTextArea2.setText("Dosyalarin icinden bulup silmesini istediginiz \nisaret ve kelimeleri virgulle ayirarak yaziniz.");
jScrollPane1.setViewportView(jTextArea2);
jLabel4.setText("Veritabani secimi...");
jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Sqlite", "Mysql", "Mssql", "PostgreSql" }));
jLabel5.setText("Kullanici Adi");
jLabel6.setText("Sifre");
jLabel7.setText("Veritabani alani su an aktif degil. Ileride ihtiyac olursa eklenecek.");
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jCheckBox2)
.addComponent(jCheckBox1))
.addGap(18, 18, Short.MAX_VALUE)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jTextField7)
.addComponent(jComboBox1, 0, 150, Short.MAX_VALUE))
.addGap(74, 74, 74))
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jButton3))
.addComponent(label9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1)
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(jCheckBox3, javax.swing.GroupLayout.PREFERRED_SIZE, 207, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 476, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(24, Short.MAX_VALUE))))
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(23, 23, 23)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 678, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel6))
.addGap(218, 218, 218)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jTextField2)
.addComponent(jTextField1)
.addComponent(jComboBox2, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addGap(0, 0, Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(label9, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jCheckBox1)
.addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jLabel1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jCheckBox2)
.addComponent(jComboBox1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 161, Short.MAX_VALUE)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jCheckBox3)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(29, 29, 29)
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4)
.addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addGap(28, 28, 28))
);
jTabbedPane1.addTab("Options", jPanel4);
jButton4.setText("Start");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jLabel8.setText("Info Box");
jTextArea3.setEditable(false);
jTextArea3.setBackground(java.awt.Color.orange);
jTextArea3.setColumns(20);
jTextArea3.setRows(5);
jScrollPane3.setViewportView(jTextArea3);
jLabel9.setIcon(new javax.swing.ImageIcon("/home/hasan/Desktop/unnamed.png")); // NOI18N
jLabel9.setText("Kutuphane");
jScrollPane2.setBackground(new java.awt.Color(240, 241, 242));
jScrollPane2.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
jScrollPane2.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
jScrollPane2.setEnabled(false);
jTextArea1.setEditable(false);
jTextArea1.setBackground(java.awt.SystemColor.info);
jTextArea1.setColumns(20);
jTextArea1.setRows(6);
jTextArea1.setText("Bu program Kutuphane isimli Android Uygulamasi ve \nisimli@isimsizlerhayrati.com adina \nhs@isimsizlerhayrati.com tarafindan yazilmistir.\n\nwww.isimsizlerhayrati.com\n\n");
jScrollPane2.setViewportView(jTextArea1);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 373, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(89, 89, 89)
.addComponent(jLabel9)))
.addGap(18, 18, 18)
.addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel8)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(jScrollPane3))
.addContainerGap())))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel8)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 326, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(23, 23, 23))
);
jTabbedPane1.addTab("START !!!", jPanel2);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane1)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTabbedPane1))
);
pack();
}// </editor-fold>//GEN-END:initComponents
public static int textsayac=6;
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
JPanel panel5 = new JPanel();
panel5.setLayout(new BoxLayout(panel5, BoxLayout.X_AXIS));
panel5.add(new JLabel(textsayac+". Parse text"));
JTextField tt=new JTextField(15);
panel5.add(tt);
jPanel3.add(panel5);
jt.add(tt);
textsayac++;
System.out.println(textsayac+"\n");
validate();
}//GEN-LAST:event_jButton1ActionPerformed
private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jComboBox1ActionPerformed
ArrayList<String> parserStr=new ArrayList<String>();
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
ParserStrAyikla();
if(WORKING==0){
if(directorySelected==1){
jTextArea3.setText(jTextField5.getText()+" klasoru altindaki tum dosyalar taranacak..."+"\n"+jTextArea3.getText());
}
if(DatabaseNameSet==1){
jTextArea3.setText(jTextField7.getText()+" ismiyle bir veritabani olusuturulacak..."+"\n"+jTextArea3.getText());
}
if(ThreadNumber==1){
if(jComboBox1.getSelectedIndex()!=0){
jTextArea3.setText(jComboBox1.getSelectedItem()+" adet thread olusturulacak..."+"\n"+jTextArea3.getText());
}
else{
jTextArea3.setText("Thread sayisi secilmemis.Tek islemde yapilacak..."+"\n"+jTextArea3.getText());
}
}
if(Ayiklama==1){
jTextArea3.setText("Ayiklama islemi yapilacak..."+"\n"+jTextArea3.getText());
}
if(directorySelected==0){
jTextArea3.setText(jTextField5.getText()+" isimli dosya taranacak. Klasor Secilmemis!"+"\n"+jTextArea3.getText());
}
if(Ayiklama==0){
jTextArea3.setText("Ayiklama islemi yapilmayacak..."+"\n"+jTextArea3.getText());
}
if(ThreadNumber==0){
jTextArea3.setText("Thread sayisi secilmemis.Tek islemde yapilacak..."+"\n"+jTextArea3.getText());
}
if(DatabaseNameSet==0){
int aboo = (int)(Math.random()*100000);
DBNAME="DEFAULT"+aboo;
jTextArea3.setText(DBNAME+" ismiyle bir veritabani olusuturulacak..."+"\n"+jTextArea3.getText());
}
WORKING=1;
LOGGER("Worker lar olusturuluyor...");
ArrayList<File> foo2=new ArrayList<File>();
jButton4.setText("Working....");
validate();
System.out.println(jComboBox1.getSelectedItem().toString());
File f=new File(jTextField5.getText());
if(f.isDirectory()){
File[] foo = f.listFiles();
for(int i=0;i<foo.length;i++){
if(foo[i].isFile())
foo2.add(foo[i]);
}
if((Integer.parseInt(jComboBox1.getSelectedItem().toString())>1)){
new MainWorker(jTextArea3,foo2,Integer.parseInt(jComboBox1.getSelectedItem().toString())).run();
}
else{
new MainWorker(jTextArea3,foo2).run();
}
}
else if(f.isFile()){
new MainWorker(jTextArea3,f).run();
}
}
else{
WORKING=0;
jButton4.setText("Start");
validate();
this.dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
}
}//GEN-LAST:event_jButton4ActionPerformed
JFileChooser chooser;
int WORKING=0;
String choosertitle="choose file or folder...";
int directorySelected=0;
int DatabaseNameSet;
int ThreadNumber;
public static String DBNAME;
int Ayiklama;
public void LOGGER(String s){
jTextArea3.setText(s+"\n"+jTextArea3.getText());
validate();
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
directorySelected=0;
chooser = new JFileChooser();
chooser.setCurrentDirectory(new java.io.File("."));
chooser.setDialogTitle(choosertitle);
chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
//chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
//
// disable the "All files" option.
//
// chooser.setAcceptAllFileFilterUsed(false);
//
if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
if((chooser.getSelectedFile()).isDirectory()){
directorySelected=1;
jTextField5.setText(chooser.getSelectedFile().toString());
validate();
}
else{
directorySelected=0;
jTextField5.setText(chooser.getSelectedFile().toString());
validate();
}
}
else {
System.out.println("No Selection ");
}
}//GEN-LAST:event_jButton3ActionPerformed
private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
if(jCheckBox1.isSelected()){
DatabaseNameSet=1;}
else{DatabaseNameSet=0;}
}//GEN-LAST:event_jCheckBox1ActionPerformed
private void jCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox2ActionPerformed
if(jCheckBox2.isSelected()){
ThreadNumber=1;}
else{ThreadNumber=0;}
}//GEN-LAST:event_jCheckBox2ActionPerformed
private void jCheckBox3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox3ActionPerformed
if(jCheckBox3.isSelected()){
Ayiklama=1;}
else{Ayiklama=0;}
}//GEN-LAST:event_jCheckBox3ActionPerformed
private void jTextField7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField7ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField7ActionPerformed
/**
* @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(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(NewJFrame.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 NewJFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JCheckBox jCheckBox1;
private javax.swing.JCheckBox jCheckBox2;
private javax.swing.JCheckBox jCheckBox3;
private javax.swing.JComboBox jComboBox1;
private javax.swing.JComboBox jComboBox2;
private javax.swing.JLabel jLabel1;
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.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenu jMenu3;
private javax.swing.JMenu jMenu4;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextArea jTextArea2;
private javax.swing.JTextArea jTextArea3;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField5;
private javax.swing.JTextField jTextField7;
private java.awt.Label label9;
// End of variables declaration//GEN-END:variables
private void ParserStrAyikla() {
System.out.println(jPanel3.getComponentCount());
String s="";
for(int i=0;i<jt.size();i++){
System.out.println(jt.get(i).getText());
s+=jt.get(i).getText();
s+="-";
}
LOGGER(s+" Sirasiyla parse edilecek.");
}
}