Guest User

Untitled

a guest
Apr 26th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 49.09 KB | None | 0 0
  1. package backprop;
  2.  
  3. /*
  4. * cobaBekprop.java
  5. *
  6. * Created on 16 November 2009, 22:02
  7. */
  8.  
  9. /**
  10. *
  11. * @author Danang-Rin
  12. */
  13. public class guiBackprop extends javax.swing.JFrame {
  14. static int array;
  15. static int banyak;
  16. static int hidden;
  17. static double toleransi;
  18. static double alpha;
  19. static String tempString;
  20. static int[][] x=new int[16][15];
  21. static int[][] t=new int[16][4];
  22. static int[] ujix=new int[15];
  23. static int i;
  24. //static int[] hasilTarget=new int[3];
  25. static String huruf[]=new String[16];
  26. String huruf2;
  27. int barisInput=0;
  28.  
  29.  
  30.  
  31. /** Creates new form cobaBekprop */
  32. public guiBackprop() {
  33. initComponents();
  34.  
  35. }
  36.  
  37. /** This method is called from within the constructor to
  38. * initialize the form.
  39. * WARNING: Do NOT modify this code. The content of this method is
  40. * always regenerated by the Form Editor.
  41. */
  42. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  43. private void initComponents() {
  44.  
  45. jDialog1 = new javax.swing.JDialog();
  46. jPanel1 = new javax.swing.JPanel();
  47. jLabel7 = new javax.swing.JLabel();
  48. latih = new javax.swing.JButton();
  49. jLabel2 = new javax.swing.JLabel();
  50. hiddenInput = new javax.swing.JTextField();
  51. jLabel3 = new javax.swing.JLabel();
  52. toleransiInput = new javax.swing.JTextField();
  53. jLabel4 = new javax.swing.JLabel();
  54. alphaInput = new javax.swing.JTextField();
  55. jLabel6 = new javax.swing.JLabel();
  56. x12 = new javax.swing.JCheckBox();
  57. x13 = new javax.swing.JCheckBox();
  58. x14 = new javax.swing.JCheckBox();
  59. x3 = new javax.swing.JCheckBox();
  60. x4 = new javax.swing.JCheckBox();
  61. x5 = new javax.swing.JCheckBox();
  62. x0 = new javax.swing.JCheckBox();
  63. x1 = new javax.swing.JCheckBox();
  64. x2 = new javax.swing.JCheckBox();
  65. x9 = new javax.swing.JCheckBox();
  66. x10 = new javax.swing.JCheckBox();
  67. x11 = new javax.swing.JCheckBox();
  68. x6 = new javax.swing.JCheckBox();
  69. x7 = new javax.swing.JCheckBox();
  70. x8 = new javax.swing.JCheckBox();
  71. input = new javax.swing.JButton();
  72. target0 = new javax.swing.JCheckBox();
  73. target1 = new javax.swing.JCheckBox();
  74. target2 = new javax.swing.JCheckBox();
  75. jLabel5 = new javax.swing.JLabel();
  76. jLabel1 = new javax.swing.JLabel();
  77. jLabel11 = new javax.swing.JLabel();
  78. tampil = new javax.swing.JTextArea();
  79. hurufInput = new javax.swing.JTextArea();
  80. jScrollPane1 = new javax.swing.JScrollPane();
  81. target3 = new javax.swing.JCheckBox();
  82. jLabel14 = new javax.swing.JLabel();
  83. banyakInput = new javax.swing.JTextField();
  84. jPanel2 = new javax.swing.JPanel();
  85. jLabel8 = new javax.swing.JLabel();
  86. jLabel9 = new javax.swing.JLabel();
  87. ujix0 = new javax.swing.JCheckBox();
  88. ujix1 = new javax.swing.JCheckBox();
  89. ujix2 = new javax.swing.JCheckBox();
  90. ujix3 = new javax.swing.JCheckBox();
  91. ujix4 = new javax.swing.JCheckBox();
  92. ujix5 = new javax.swing.JCheckBox();
  93. ujix6 = new javax.swing.JCheckBox();
  94. ujix7 = new javax.swing.JCheckBox();
  95. ujix8 = new javax.swing.JCheckBox();
  96. ujix9 = new javax.swing.JCheckBox();
  97. ujix10 = new javax.swing.JCheckBox();
  98. ujix11 = new javax.swing.JCheckBox();
  99. ujix12 = new javax.swing.JCheckBox();
  100. ujix13 = new javax.swing.JCheckBox();
  101. ujix14 = new javax.swing.JCheckBox();
  102. jLabel10 = new javax.swing.JLabel();
  103. tampilUji = new javax.swing.JTextArea();
  104. uji = new javax.swing.JButton();
  105. jScrollPane2 = new javax.swing.JScrollPane();
  106. tampilUjiHuruf = new javax.swing.JTextArea();
  107. jLabel12 = new javax.swing.JLabel();
  108. jLabel13 = new javax.swing.JLabel();
  109.  
  110. jDialog1.setTitle("Jumlah yang anda masukkan melebihi batas");
  111.  
  112. javax.swing.GroupLayout jDialog1Layout = new javax.swing.GroupLayout(jDialog1.getContentPane());
  113. jDialog1.getContentPane().setLayout(jDialog1Layout);
  114. jDialog1Layout.setHorizontalGroup(
  115. jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  116. .addGap(0, 400, Short.MAX_VALUE)
  117. );
  118. jDialog1Layout.setVerticalGroup(
  119. jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  120. .addGap(0, 300, Short.MAX_VALUE)
  121. );
  122.  
  123. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  124. setTitle("BACKPROPAGATION");
  125. setBackground(new java.awt.Color(255, 255, 255));
  126.  
  127. jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
  128. jPanel1.setPreferredSize(new java.awt.Dimension(50, 100));
  129.  
  130. jLabel7.setFont(new java.awt.Font("Tahoma", 1, 18));
  131. jLabel7.setText("PELATIHAN");
  132.  
  133. latih.setText("LATIH");
  134. latih.addActionListener(new java.awt.event.ActionListener() {
  135. public void actionPerformed(java.awt.event.ActionEvent evt) {
  136. latihActionPerformed(evt);
  137. }
  138. });
  139.  
  140. jLabel2.setFont(new java.awt.Font("Comic Sans MS", 1, 11)); // NOI18N
  141. jLabel2.setText("Hidden Layer :");
  142.  
  143. hiddenInput.addKeyListener(new java.awt.event.KeyAdapter() {
  144. public void keyReleased(java.awt.event.KeyEvent evt) {
  145. hiddenInputKeyReleased(evt);
  146. }
  147. });
  148.  
  149. jLabel3.setFont(new java.awt.Font("Comic Sans MS", 1, 11)); // NOI18N
  150. jLabel3.setText("Toleransi :");
  151.  
  152. toleransiInput.addKeyListener(new java.awt.event.KeyAdapter() {
  153. public void keyReleased(java.awt.event.KeyEvent evt) {
  154. toleransiInputKeyReleased(evt);
  155. }
  156. });
  157.  
  158. jLabel4.setFont(new java.awt.Font("Comic Sans MS", 1, 11)); // NOI18N
  159. jLabel4.setText("Alpha :");
  160.  
  161. alphaInput.addKeyListener(new java.awt.event.KeyAdapter() {
  162. public void keyReleased(java.awt.event.KeyEvent evt) {
  163. alphaInputKeyReleased(evt);
  164. }
  165. });
  166.  
  167. jLabel6.setFont(new java.awt.Font("Comic Sans MS", 1, 11));
  168. jLabel6.setText("Message ");
  169.  
  170. x12.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  171. x12.setMargin(new java.awt.Insets(0, 0, 0, 0));
  172.  
  173. x13.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  174. x13.setMargin(new java.awt.Insets(0, 0, 0, 0));
  175.  
  176. x14.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  177. x14.setMargin(new java.awt.Insets(0, 0, 0, 0));
  178.  
  179. x3.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  180. x3.setMargin(new java.awt.Insets(0, 0, 0, 0));
  181.  
  182. x4.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  183. x4.setMargin(new java.awt.Insets(0, 0, 0, 0));
  184.  
  185. x5.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  186. x5.setMargin(new java.awt.Insets(0, 0, 0, 0));
  187.  
  188. x0.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  189. x0.setMargin(new java.awt.Insets(0, 0, 0, 0));
  190.  
  191. x1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  192. x1.setMargin(new java.awt.Insets(0, 0, 0, 0));
  193.  
  194. x2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  195. x2.setMargin(new java.awt.Insets(0, 0, 0, 0));
  196.  
  197. x9.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  198. x9.setMargin(new java.awt.Insets(0, 0, 0, 0));
  199.  
  200. x10.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  201. x10.setMargin(new java.awt.Insets(0, 0, 0, 0));
  202.  
  203. x11.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  204. x11.setMargin(new java.awt.Insets(0, 0, 0, 0));
  205.  
  206. x6.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  207. x6.setMargin(new java.awt.Insets(0, 0, 0, 0));
  208.  
  209. x7.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  210. x7.setMargin(new java.awt.Insets(0, 0, 0, 0));
  211.  
  212. x8.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  213. x8.setMargin(new java.awt.Insets(0, 0, 0, 0));
  214.  
  215. input.setText("Simpan");
  216. input.addActionListener(new java.awt.event.ActionListener() {
  217. public void actionPerformed(java.awt.event.ActionEvent evt) {
  218. inputActionPerformed(evt);
  219. }
  220. });
  221.  
  222. target0.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  223. target0.setFocusCycleRoot(true);
  224. target0.setMargin(new java.awt.Insets(0, 0, 0, 0));
  225.  
  226. target1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  227. target1.setMargin(new java.awt.Insets(0, 0, 0, 0));
  228.  
  229. target2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  230. target2.setMargin(new java.awt.Insets(0, 0, 0, 0));
  231.  
  232. jLabel5.setFont(new java.awt.Font("Comic Sans MS", 1, 11));
  233. jLabel5.setText(" Target");
  234.  
  235. jLabel1.setFont(new java.awt.Font("Comic Sans MS", 1, 11)); // NOI18N
  236. jLabel1.setText(" HURUF");
  237.  
  238. jLabel11.setFont(new java.awt.Font("Comic Sans MS", 1, 11));
  239. jLabel11.setText("POLA");
  240.  
  241. tampil.setColumns(20);
  242. tampil.setRows(5);
  243. tampil.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
  244.  
  245. hurufInput.setColumns(20);
  246. hurufInput.setFont(new java.awt.Font("Comic Sans MS", 0, 36));
  247. hurufInput.setRows(5);
  248. hurufInput.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
  249.  
  250. target3.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  251. target3.setMargin(new java.awt.Insets(0, 0, 0, 0));
  252.  
  253. jLabel14.setFont(new java.awt.Font("Comic Sans MS", 1, 11)); // NOI18N
  254. jLabel14.setText("Banyak Huruf :");
  255.  
  256. banyakInput.addKeyListener(new java.awt.event.KeyAdapter() {
  257. public void keyReleased(java.awt.event.KeyEvent evt) {
  258. banyakInputKeyReleased(evt);
  259. }
  260. });
  261.  
  262. javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
  263. jPanel1.setLayout(jPanel1Layout);
  264. jPanel1Layout.setHorizontalGroup(
  265. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  266. .addGroup(jPanel1Layout.createSequentialGroup()
  267. .addGap(16, 16, 16)
  268. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  269. .addGroup(jPanel1Layout.createSequentialGroup()
  270. .addGap(34, 34, 34)
  271. .addComponent(tampil, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE))
  272. .addGroup(jPanel1Layout.createSequentialGroup()
  273. .addGap(102, 102, 102)
  274. .addComponent(jLabel6))
  275. .addGroup(jPanel1Layout.createSequentialGroup()
  276. .addGap(20, 20, 20)
  277. .addComponent(input)
  278. .addGap(95, 95, 95)
  279. .addComponent(latih)))
  280. .addGap(28, 28, 28)
  281. .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  282. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  283. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
  284. .addGap(28, 28, 28)
  285. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  286. .addGroup(jPanel1Layout.createSequentialGroup()
  287. .addComponent(x12)
  288. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  289. .addComponent(x13)
  290. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  291. .addComponent(x14))
  292. .addGroup(jPanel1Layout.createSequentialGroup()
  293. .addComponent(x3)
  294. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  295. .addComponent(x4)
  296. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  297. .addComponent(x5))
  298. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
  299. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  300. .addGroup(jPanel1Layout.createSequentialGroup()
  301. .addComponent(x9)
  302. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  303. .addComponent(x10)
  304. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  305. .addComponent(x11))
  306. .addGroup(jPanel1Layout.createSequentialGroup()
  307. .addComponent(x6)
  308. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  309. .addComponent(x7)
  310. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  311. .addComponent(x8))
  312. .addGroup(jPanel1Layout.createSequentialGroup()
  313. .addComponent(x0)
  314. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  315. .addComponent(x1, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)
  316. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  317. .addComponent(x2, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE))
  318. .addComponent(jLabel11))
  319. .addGap(11, 11, 11)))
  320. .addGap(18, 18, 18)
  321. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  322. .addComponent(hurufInput, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
  323. .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
  324. .addGap(34, 34, 34)
  325. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  326. .addComponent(jLabel5)
  327. .addGroup(jPanel1Layout.createSequentialGroup()
  328. .addComponent(target0)
  329. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  330. .addComponent(target1)
  331. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  332. .addComponent(target2)
  333. .addGap(6, 6, 6)
  334. .addComponent(target3)))
  335. .addContainerGap(23, Short.MAX_VALUE))
  336. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
  337. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  338. .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
  339. .addGap(22, 22, 22)
  340. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  341. .addGroup(jPanel1Layout.createSequentialGroup()
  342. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  343. .addGroup(jPanel1Layout.createSequentialGroup()
  344. .addComponent(jLabel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  345. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 32, Short.MAX_VALUE))
  346. .addGroup(jPanel1Layout.createSequentialGroup()
  347. .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE)
  348. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
  349. .addGroup(jPanel1Layout.createSequentialGroup()
  350. .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE)
  351. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
  352. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  353. .addComponent(alphaInput)
  354. .addComponent(toleransiInput)
  355. .addComponent(hiddenInput)
  356. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
  357. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  358. .addComponent(banyakInput, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))
  359. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE))
  360. .addComponent(jLabel3)))
  361. .addGroup(jPanel1Layout.createSequentialGroup()
  362. .addGap(80, 80, 80)
  363. .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)))
  364. .addGap(61, 61, 61))
  365. );
  366. jPanel1Layout.setVerticalGroup(
  367. jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  368. .addGroup(jPanel1Layout.createSequentialGroup()
  369. .addComponent(jLabel7)
  370. .addGap(36, 36, 36)
  371. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  372. .addComponent(jLabel14)
  373. .addComponent(banyakInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  374. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  375. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  376. .addComponent(jLabel2)
  377. .addComponent(hiddenInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  378. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  379. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  380. .addComponent(jLabel3)
  381. .addComponent(toleransiInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  382. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  383. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  384. .addComponent(jLabel4)
  385. .addComponent(alphaInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  386. .addGap(53, 53, 53)
  387. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  388. .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
  389. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  390. .addComponent(jLabel5)
  391. .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)))
  392. .addGap(6, 6, 6)
  393. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  394. .addGroup(jPanel1Layout.createSequentialGroup()
  395. .addGap(6, 6, 6)
  396. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  397. .addGroup(jPanel1Layout.createSequentialGroup()
  398. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  399. .addComponent(x2)
  400. .addComponent(x1)
  401. .addComponent(x0))
  402. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  403. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  404. .addComponent(x3)
  405. .addComponent(x4)
  406. .addComponent(x5))
  407. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  408. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  409. .addComponent(x6)
  410. .addComponent(x7)
  411. .addComponent(x8))
  412. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  413. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  414. .addComponent(x9)
  415. .addComponent(x10)
  416. .addComponent(x11))
  417. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  418. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  419. .addComponent(x12)
  420. .addComponent(x13)
  421. .addComponent(x14)))
  422. .addComponent(hurufInput, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)))
  423. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  424. .addComponent(target1)
  425. .addComponent(target0)
  426. .addComponent(target3)
  427. .addComponent(target2)))
  428. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  429. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  430. .addGroup(jPanel1Layout.createSequentialGroup()
  431. .addGap(38, 38, 38)
  432. .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  433. .addContainerGap(217, Short.MAX_VALUE))
  434. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
  435. .addGap(46, 46, 46)
  436. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  437. .addComponent(input)
  438. .addComponent(latih))
  439. .addGap(18, 18, 18)
  440. .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
  441. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  442. .addComponent(tampil, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
  443. .addGap(37, 37, 37))))
  444. );
  445.  
  446. jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
  447.  
  448. jLabel8.setFont(new java.awt.Font("Tahoma", 1, 18));
  449. jLabel8.setText("PENGUJIAN");
  450.  
  451. jLabel9.setFont(new java.awt.Font("Comic Sans MS", 1, 11));
  452. jLabel9.setText("POLA UJI");
  453.  
  454. ujix0.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  455. ujix0.setMargin(new java.awt.Insets(0, 0, 0, 0));
  456.  
  457. ujix1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  458. ujix1.setMargin(new java.awt.Insets(0, 0, 0, 0));
  459.  
  460. ujix2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  461. ujix2.setMargin(new java.awt.Insets(0, 0, 0, 0));
  462.  
  463. ujix3.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  464. ujix3.setMargin(new java.awt.Insets(0, 0, 0, 0));
  465.  
  466. ujix4.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  467. ujix4.setMargin(new java.awt.Insets(0, 0, 0, 0));
  468.  
  469. ujix5.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  470. ujix5.setMargin(new java.awt.Insets(0, 0, 0, 0));
  471.  
  472. ujix6.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  473. ujix6.setMargin(new java.awt.Insets(0, 0, 0, 0));
  474.  
  475. ujix7.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  476. ujix7.setMargin(new java.awt.Insets(0, 0, 0, 0));
  477.  
  478. ujix8.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  479. ujix8.setMargin(new java.awt.Insets(0, 0, 0, 0));
  480.  
  481. ujix9.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  482. ujix9.setMargin(new java.awt.Insets(0, 0, 0, 0));
  483.  
  484. ujix10.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  485. ujix10.setMargin(new java.awt.Insets(0, 0, 0, 0));
  486.  
  487. ujix11.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  488. ujix11.setMargin(new java.awt.Insets(0, 0, 0, 0));
  489.  
  490. ujix12.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  491. ujix12.setMargin(new java.awt.Insets(0, 0, 0, 0));
  492.  
  493. ujix13.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  494. ujix13.setMargin(new java.awt.Insets(0, 0, 0, 0));
  495.  
  496. ujix14.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
  497. ujix14.setMargin(new java.awt.Insets(0, 0, 0, 0));
  498.  
  499. jLabel10.setFont(new java.awt.Font("Comic Sans MS", 1, 11)); // NOI18N
  500. jLabel10.setText("Message ");
  501.  
  502. tampilUji.setColumns(20);
  503. tampilUji.setRows(5);
  504. tampilUji.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
  505.  
  506. uji.setText("UJI");
  507. uji.addActionListener(new java.awt.event.ActionListener() {
  508. public void actionPerformed(java.awt.event.ActionEvent evt) {
  509. ujiActionPerformed(evt);
  510. }
  511. });
  512.  
  513. tampilUjiHuruf.setColumns(20);
  514. tampilUjiHuruf.setFont(new java.awt.Font("Comic Sans MS", 0, 36));
  515. tampilUjiHuruf.setRows(5);
  516. tampilUjiHuruf.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
  517.  
  518. jLabel12.setFont(new java.awt.Font("Comic Sans MS", 1, 11));
  519. jLabel12.setText("HURUF");
  520.  
  521. jLabel13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/backprop/gambar.png"))); // NOI18N
  522.  
  523. javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
  524. jPanel2.setLayout(jPanel2Layout);
  525. jPanel2Layout.setHorizontalGroup(
  526. jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  527. .addGroup(jPanel2Layout.createSequentialGroup()
  528. .addGap(34, 34, 34)
  529. .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  530. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
  531. .addContainerGap(94, Short.MAX_VALUE)
  532. .addComponent(jLabel8)
  533. .addGap(106, 106, 106))
  534. .addGroup(jPanel2Layout.createSequentialGroup()
  535. .addGap(21, 21, 21)
  536. .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 255, javax.swing.GroupLayout.PREFERRED_SIZE)
  537. .addContainerGap(31, Short.MAX_VALUE))
  538. .addGroup(jPanel2Layout.createSequentialGroup()
  539. .addGap(54, 54, 54)
  540. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  541. .addComponent(tampilUji, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE)
  542. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
  543. .addComponent(jLabel10)
  544. .addGap(67, 67, 67)))
  545. .addContainerGap(56, Short.MAX_VALUE))
  546. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
  547. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  548. .addGroup(jPanel2Layout.createSequentialGroup()
  549. .addGap(46, 46, 46)
  550. .addComponent(uji, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
  551. .addGap(120, 120, 120))
  552. .addGroup(jPanel2Layout.createSequentialGroup()
  553. .addGap(56, 56, 56)
  554. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  555. .addGroup(jPanel2Layout.createSequentialGroup()
  556. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  557. .addComponent(jLabel9)
  558. .addGroup(jPanel2Layout.createSequentialGroup()
  559. .addComponent(ujix9)
  560. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  561. .addComponent(ujix10)
  562. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  563. .addComponent(ujix11))
  564. .addGroup(jPanel2Layout.createSequentialGroup()
  565. .addComponent(ujix6)
  566. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  567. .addComponent(ujix7)
  568. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  569. .addComponent(ujix8))
  570. .addGroup(jPanel2Layout.createSequentialGroup()
  571. .addComponent(ujix3)
  572. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  573. .addComponent(ujix4)
  574. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  575. .addComponent(ujix5))
  576. .addGroup(jPanel2Layout.createSequentialGroup()
  577. .addComponent(ujix0)
  578. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  579. .addComponent(ujix1)
  580. .addGap(6, 6, 6)
  581. .addComponent(ujix2)))
  582. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 75, Short.MAX_VALUE)
  583. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  584. .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
  585. .addComponent(tampilUjiHuruf, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)))
  586. .addGroup(jPanel2Layout.createSequentialGroup()
  587. .addComponent(ujix12)
  588. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  589. .addComponent(ujix13)
  590. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  591. .addComponent(ujix14)
  592. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 135, javax.swing.GroupLayout.PREFERRED_SIZE)))))
  593. .addGap(65, 65, 65))
  594. );
  595. jPanel2Layout.setVerticalGroup(
  596. jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  597. .addGroup(jPanel2Layout.createSequentialGroup()
  598. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  599. .addComponent(jLabel8)
  600. .addGroup(jPanel2Layout.createSequentialGroup()
  601. .addGap(38, 38, 38)
  602. .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)))
  603. .addGap(75, 75, 75)
  604. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  605. .addGroup(jPanel2Layout.createSequentialGroup()
  606. .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
  607. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  608. .addComponent(tampilUjiHuruf, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
  609. .addGap(124, 124, 124)
  610. .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
  611. .addGroup(jPanel2Layout.createSequentialGroup()
  612. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  613. .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
  614. .addGroup(jPanel2Layout.createSequentialGroup()
  615. .addGap(20, 20, 20)
  616. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  617. .addComponent(ujix0)
  618. .addComponent(ujix1)
  619. .addComponent(ujix2))
  620. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  621. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  622. .addComponent(ujix3)
  623. .addComponent(ujix4)
  624. .addComponent(ujix5))
  625. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  626. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  627. .addComponent(ujix6)
  628. .addComponent(ujix7)
  629. .addComponent(ujix8))
  630. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  631. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  632. .addComponent(ujix9)
  633. .addComponent(ujix10)
  634. .addComponent(ujix11))))
  635. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  636. .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  637. .addComponent(ujix12)
  638. .addComponent(ujix13)
  639. .addComponent(ujix14))
  640. .addGap(61, 61, 61)
  641. .addComponent(uji)))
  642. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  643. .addComponent(tampilUji, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
  644. .addGap(33, 33, 33)
  645. .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  646. .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  647. );
  648.  
  649. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  650. getContentPane().setLayout(layout);
  651. layout.setHorizontalGroup(
  652. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  653. .addGroup(layout.createSequentialGroup()
  654. .addContainerGap()
  655. .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 293, javax.swing.GroupLayout.PREFERRED_SIZE)
  656. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
  657. .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  658. .addContainerGap())
  659. );
  660. layout.setVerticalGroup(
  661. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  662. .addGroup(layout.createSequentialGroup()
  663. .addContainerGap()
  664. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  665. .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 586, Short.MAX_VALUE)
  666. .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 586, Short.MAX_VALUE))
  667. .addContainerGap())
  668. );
  669.  
  670. pack();
  671. }// </editor-fold>
  672.  
  673. private void ujiActionPerformed(java.awt.event.ActionEvent evt) {
  674. simpanUji();
  675. backpropFunc.uji(backpropFunc.v, backpropFunc.w, hidden, array, banyak);
  676.  
  677. tampilUji.setText("y yang didapat : \n");
  678.  
  679. for(i=0;i<=array-1;i++){
  680. tampilUji.append(backpropFunc.y_in[i]+" ");
  681. tampilUji.append("\n");
  682. }
  683.  
  684. tampilUji.append("\n");
  685.  
  686. for(i=0;i<=array-1;i++){
  687. tampilUji.append(backpropFunc.hasilUji[i]+" ");
  688. }
  689.  
  690. tampilUjiHuruf.setText(huruf[backpropFunc.baris]);
  691. //tampilUji.setText(fungsiBekprop.hasilUji[0]+" "+fungsiBekprop.hasilUji[1]+" "+fungsiBekprop.hasilUji[2]+" "+huruf[fungsiBekprop.baris]);
  692. }
  693.  
  694. private void latihActionPerformed(java.awt.event.ActionEvent evt) {
  695.  
  696. backpropFunc.backprop(backpropFunc.v, backpropFunc.w, hidden, toleransi, alpha, array, banyak);
  697.  
  698. tampil.setText("EPOCH = "+backpropFunc.epoch+" \n");
  699. tampil.append(" ");
  700. tampil.append("Jumlah Hidden Layer = "+hidden+" \n");
  701. tampil.append("Nilai Toleransi ="+toleransi+" \n");
  702. tampil.append("Nilai Alpha ="+alpha);
  703. }
  704.  
  705.  
  706. private void inputActionPerformed(java.awt.event.ActionEvent evt) {
  707. simpan(barisInput);
  708. huruf2=hurufInput.getText();
  709. huruf[barisInput]=huruf2;
  710.  
  711. tampil.setText("Huruf "+huruf[barisInput]+" : \n");
  712.  
  713. /**/ for(i=0;i<=14;i++){
  714. tampil.append(x[barisInput][i]+" ");
  715. }
  716.  
  717. tampil.append("\n\nTarget : \n");
  718.  
  719. for(i=0;i<=array-1;i++){
  720. tampil.append(t[barisInput][i]+" ");
  721. }
  722.  
  723. barisInput+=1;
  724.  
  725. }
  726.  
  727. private void hiddenInputKeyReleased(java.awt.event.KeyEvent evt) {
  728. hidden=Integer.parseInt(hiddenInput.getText());
  729. backpropFunc.random(hidden, array);
  730.  
  731. tampil.setText("Input hidden : "+ hidden);
  732. }
  733.  
  734. private void toleransiInputKeyReleased(java.awt.event.KeyEvent evt) {
  735. toleransi = Double.parseDouble(toleransiInput.getText());
  736. tampil.setText("Input toleransi : "+ toleransi);
  737. }
  738.  
  739. private void banyakInputKeyReleased(java.awt.event.KeyEvent evt) {
  740. banyak = Integer.parseInt(banyakInput.getText());
  741. tampil.setText("Banyak huruf : "+ banyak);
  742.  
  743. muncul();
  744. pesan();
  745. }
  746.  
  747. private void alphaInputKeyReleased(java.awt.event.KeyEvent evt) {
  748. alpha = Double.parseDouble(alphaInput.getText());
  749. tampil.setText("Input alpha : "+ alpha);
  750. }
  751.  
  752. static void muncul(){
  753.  
  754. if(banyak>0 && banyak<=2){
  755. target0.setVisible(true);
  756. target1.setVisible(false);
  757. target2.setVisible(false);
  758. target3.setVisible(false);
  759.  
  760. array = 1;
  761. }else{
  762.  
  763. if(banyak>2 && banyak<=4){
  764. target0.setVisible(true);
  765. target1.setVisible(true);
  766. target2.setVisible(false);
  767. target3.setVisible(false);
  768.  
  769. array = 2;
  770. }else{
  771.  
  772. if(banyak>4 && banyak<=8){
  773. target0.setVisible(true);
  774. target1.setVisible(true);
  775. target2.setVisible(true);
  776. target3.setVisible(false);
  777.  
  778. array = 3;
  779. }else{
  780.  
  781. if(banyak>8 && banyak<=16){
  782. target0.setVisible(true);
  783. target1.setVisible(true);
  784. target2.setVisible(true);
  785. target3.setVisible(true);
  786.  
  787. array = 4;
  788. }else{
  789. target0.setVisible(false);
  790. target1.setVisible(false);
  791. target2.setVisible(false);
  792. target3.setVisible(false);
  793. }
  794. }
  795. }
  796. }
  797. }
  798.  
  799. void pesan(){
  800. if(banyak>16)
  801. tampil.setText("Banyak huruf yang anda masukkan \nmelebihi batas \n\nBatas maksimal adalah 16");
  802. }
  803.  
  804. static void simpan(int i){
  805. if(x0.isSelected()){
  806. x[i][0]=1;
  807. // error.showMessageDialog(null,"JANGAN DICENTANG!!!","ERROR",error.ERROR_MESSAGE);
  808. }else{ x[i][0]=-1;}
  809.  
  810. if(x1.isSelected()){
  811. x[i][1]=1;
  812. }else{ x[i][1]=-1;}
  813.  
  814. if(x2.isSelected()){
  815. x[i][2]=1;
  816. }else{ x[i][2]=-1;}
  817.  
  818. if(x3.isSelected()){
  819. x[i][3]=1;
  820. }else{x[i][3]=-1;}
  821.  
  822. if(x4.isSelected()){
  823. x[i][4]=1;
  824. }else{x[i][4]=-1; }
  825.  
  826. if(x5.isSelected()){
  827. x[i][5]=1;
  828. }else{x[i][5]=-1; }
  829.  
  830. if(x6.isSelected()){
  831. x[i][6]=1;
  832. }else{x[i][6]=-1; }
  833.  
  834. if(x7.isSelected()){
  835. x[i][7]=1;
  836. }else{x[i][7]=-1; }
  837.  
  838. if(x8.isSelected()){
  839. x[i][8]=1;
  840. }else{x[i][8]=-1; }
  841.  
  842. if(x9.isSelected()){
  843. x[i][9]=1;
  844. }else{x[i][9]=-1; }
  845.  
  846. if(x10.isSelected()){
  847. x[i][10]=1;
  848. }else{ x[i][10]=-1; }
  849.  
  850. if(x11.isSelected()){
  851. x[i][11]=1;
  852. }else{x[i][11]=-1; }
  853.  
  854. if(x12.isSelected()){
  855. x[i][12]=1;
  856. }else{x[i][12]=-1;}
  857.  
  858. if(x13.isSelected()){
  859. x[i][13]=1;
  860. }else{x[i][13]=-1;}
  861.  
  862. if(x14.isSelected()){
  863. x[i][14]=1;
  864. }else{x[i][14]=-1;}
  865.  
  866. //BACA TARGET
  867. if(target0.isSelected()){
  868. t[i][0]=1;
  869. }else{t[i][0]=-1;}
  870.  
  871. if(target1.isSelected()){
  872. t[i][1]=1;
  873. }else{t[i][1]=-1;}
  874.  
  875. if(target2.isSelected()){
  876. t[i][2]=1;
  877. }else{t[i][2]=-1;}
  878.  
  879. if(target3.isSelected()){
  880. t[i][3]=1;
  881. }else{t[i][3]=-1;}
  882.  
  883. }
  884.  
  885.  
  886. static void simpanUji(){
  887. if(ujix0.isSelected()){
  888. ujix[0]=1;
  889. // error.showMessageDialog(null,"JANGAN DICENTANG!!!","ERROR",error.ERROR_MESSAGE);
  890. }else{ ujix[0]=-1;}
  891.  
  892. if(ujix1.isSelected()){
  893. ujix[1]=1;
  894. }else{ ujix[1]=-1;}
  895.  
  896. if(ujix2.isSelected()){
  897. ujix[2]=1;
  898. }else{ ujix[2]=-1;}
  899.  
  900. if(ujix3.isSelected()){
  901. ujix[3]=1;
  902. }else{ujix[3]=-1;}
  903.  
  904. if(ujix4.isSelected()){
  905. ujix[4]=1;
  906. }else{ujix[4]=-1; }
  907.  
  908. if(ujix5.isSelected()){
  909. ujix[5]=1;
  910. }else{ujix[5]=-1; }
  911.  
  912. if(ujix6.isSelected()){
  913. ujix[6]=1;
  914. }else{ujix[6]=-1; }
  915.  
  916. if(ujix7.isSelected()){
  917. ujix[7]=1;
  918. }else{ujix[7]=-1; }
  919.  
  920. if(ujix8.isSelected()){
  921. ujix[8]=1;
  922. }else{ujix[8]=-1; }
  923.  
  924. if(ujix9.isSelected()){
  925. ujix[9]=1;
  926. }else{ujix[9]=-1; }
  927.  
  928. if(ujix10.isSelected()){
  929. ujix[10]=1;
  930. }else{ ujix[10]=-1; }
  931.  
  932. if(ujix11.isSelected()){
  933. ujix[11]=1;
  934. }else{ujix[11]=-1; }
  935.  
  936. if(ujix12.isSelected()){
  937. ujix[12]=1;
  938. }else{ujix[12]=-1;}
  939.  
  940. if(ujix13.isSelected()){
  941. ujix[13]=1;
  942. }else{ujix[13]=-1;}
  943.  
  944. if(ujix14.isSelected()){
  945. ujix[14]=1;
  946. }else{ujix[14]=-1;}
  947.  
  948.  
  949. }
  950.  
  951. /**
  952. * @param args the command line arguments
  953. */
  954. public static void main(String args[]) {
  955. java.awt.EventQueue.invokeLater(new Runnable() {
  956. public void run() {
  957. new guiBackprop().setVisible(true);
  958. target0.setVisible(false);
  959. target1.setVisible(false);
  960. target2.setVisible(false);
  961. target3.setVisible(false);
  962.  
  963. }
  964. });
  965.  
  966. }
  967.  
  968. // Variables declaration - do not modify
  969. private javax.swing.JTextField alphaInput;
  970. private javax.swing.JTextField banyakInput;
  971. private javax.swing.JTextField hiddenInput;
  972. private javax.swing.JTextArea hurufInput;
  973. private javax.swing.JButton input;
  974. private javax.swing.JDialog jDialog1;
  975. private javax.swing.JLabel jLabel1;
  976. private javax.swing.JLabel jLabel10;
  977. private javax.swing.JLabel jLabel11;
  978. private javax.swing.JLabel jLabel12;
  979. private javax.swing.JLabel jLabel13;
  980. private javax.swing.JLabel jLabel14;
  981. private javax.swing.JLabel jLabel2;
  982. private javax.swing.JLabel jLabel3;
  983. private javax.swing.JLabel jLabel4;
  984. private javax.swing.JLabel jLabel5;
  985. private javax.swing.JLabel jLabel6;
  986. private javax.swing.JLabel jLabel7;
  987. private javax.swing.JLabel jLabel8;
  988. private javax.swing.JLabel jLabel9;
  989. static javax.swing.JPanel jPanel1;
  990. private javax.swing.JPanel jPanel2;
  991. private javax.swing.JScrollPane jScrollPane1;
  992. private javax.swing.JScrollPane jScrollPane2;
  993. private javax.swing.JButton latih;
  994. private javax.swing.JTextArea tampil;
  995. private javax.swing.JTextArea tampilUji;
  996. private javax.swing.JTextArea tampilUjiHuruf;
  997. static javax.swing.JCheckBox target0;
  998. static javax.swing.JCheckBox target1;
  999. static javax.swing.JCheckBox target2;
  1000. static javax.swing.JCheckBox target3;
  1001. private javax.swing.JTextField toleransiInput;
  1002. private javax.swing.JButton uji;
  1003. static javax.swing.JCheckBox ujix0;
  1004. static javax.swing.JCheckBox ujix1;
  1005. static javax.swing.JCheckBox ujix10;
  1006. static javax.swing.JCheckBox ujix11;
  1007. static javax.swing.JCheckBox ujix12;
  1008. static javax.swing.JCheckBox ujix13;
  1009. static javax.swing.JCheckBox ujix14;
  1010. static javax.swing.JCheckBox ujix2;
  1011. static javax.swing.JCheckBox ujix3;
  1012. static javax.swing.JCheckBox ujix4;
  1013. static javax.swing.JCheckBox ujix5;
  1014. static javax.swing.JCheckBox ujix6;
  1015. static javax.swing.JCheckBox ujix7;
  1016. static javax.swing.JCheckBox ujix8;
  1017. static javax.swing.JCheckBox ujix9;
  1018. static javax.swing.JCheckBox x0;
  1019. static javax.swing.JCheckBox x1;
  1020. static javax.swing.JCheckBox x10;
  1021. static javax.swing.JCheckBox x11;
  1022. static javax.swing.JCheckBox x12;
  1023. static javax.swing.JCheckBox x13;
  1024. static javax.swing.JCheckBox x14;
  1025. static javax.swing.JCheckBox x2;
  1026. static javax.swing.JCheckBox x3;
  1027. static javax.swing.JCheckBox x4;
  1028. static javax.swing.JCheckBox x5;
  1029. static javax.swing.JCheckBox x6;
  1030. static javax.swing.JCheckBox x7;
  1031. static javax.swing.JCheckBox x8;
  1032. static javax.swing.JCheckBox x9;
  1033. // End of variables declaration
  1034.  
  1035. }
Add Comment
Please, Sign In to add comment