Hello Friends, Today I am going to share Java Project (MyEditor) which I Developed long time ago. This Java project is nothing but a Text Editor, In this editor you can create and modify text file. Using this editor you can manipulate multiple files at once. There is some special features in this editor, which are listed below:-
- You can compile and run java files
- You can type in hindi also in this editor
- You can read live website url html code
- Modify multiple files at once
So, Here is the code
Main.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
package jeditor; import java.awt.EventQueue; /** * * @author Rajesh Kumar Sahanee */ public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { @Override public void run() { new Editor().setVisible(true); } }); } } |
Area.java
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
package jeditor; import java.awt.BorderLayout; import java.awt.Font; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextPane; import javax.swing.border.EmptyBorder; import javax.swing.text.SimpleAttributeSet; /** * * @author Rajesh Kumar Sahanee */ class Area extends JScrollPane implements KeyListener { JTextPane jtp = new JTextPane(); JPanel panel = new JPanel(); SimpleAttributeSet attr = new SimpleAttributeSet(); Font font; boolean saved = false; boolean edited; boolean hindi = false; public int caretPosition,len; public boolean isEdited() { return edited; } public void setEdited(boolean edited) { this.edited = edited; } public void setSaved(boolean saved) { this.saved = saved; } public boolean isSaved() { return saved; } public boolean isHindi() { return hindi; } public void setHindi(boolean flag) { hindi = flag; } public Area() { initComponent(); } private void initComponent() { jtp.setBorder(new EmptyBorder(1, 1, 1, 1));//same border for synch list and jtp lines panel.setLayout(new BorderLayout()); panel.add(jtp, BorderLayout.CENTER); setViewportView(panel); setFont("Aerial", Font.PLAIN, 12); jtp.addKeyListener(this); } public JTextPane getArea() { return jtp; } public void setFont(String face, int style, int size) { font = new Font(face, style, size); jtp.setFont(font); } @Override public Font getFont(){ return font; } @Override public void keyTyped(KeyEvent e) { // jtp.getHighlighter().removeAllHighlights(); } @Override public void keyPressed(KeyEvent e) { //calculate caret position caretPosition = jtp.getCaretPosition(); len = jtp.getText().length(); setEdited(true); } @Override public void keyReleased(KeyEvent e) { //line count and update line numbers if (e.getKeyCode() != KeyEvent.VK_SPACE && e.getKeyCode() != KeyEvent.VK_LEFT && e.getKeyCode() != KeyEvent.VK_RIGHT && e.getKeyCode() != KeyEvent.VK_UP && e.getKeyCode() != KeyEvent.VK_DOWN && e.getKeyCode() != KeyEvent.VK_HOME && e.getKeyCode() != KeyEvent.VK_END && e.getKeyCode() != KeyEvent.VK_SHIFT && hindi) { String translated = Translator.toHindi(jtp.getText()); jtp.setText(translated); int len2 = translated.length(); if(caretPosition < jtp.getCaretPosition()){ jtp.setCaretPosition(caretPosition+(len2-len)); } } } } |
Editor.java
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 |
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * @author Rajesh Kumar Sahanee * * Created on Aug 12, 2012, 9:16:46 PM */ package jeditor; import java.awt.Color; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.URL; import javax.swing.ImageIcon; import javax.swing.JFileChooser; import javax.swing.JOptionPane; import javax.swing.text.DefaultHighlighter; import javax.swing.text.Highlighter; /** * * @author Rajesh */ public class Editor extends javax.swing.JFrame implements WindowListener { /** * Creates new form Editor */ public Editor() { setIconImage(new ImageIcon(getClass().getResource("/img/logo.gif")).getImage()); initComponents(); area = new Area(); addTab("Untitled", area); addWindowListener(this); output.setVisible(false); startCounter(); } private void startCounter(){ new Thread(){ @Override public void run(){ String text=""; int lastp = 0; while(running){ if(area!=null){ try{ text = "Total Line: "+ area.getArea().getText().split("\n").length+" | "; text += "Line: "+area.getArea().getText(0, area.getArea().getCaretPosition()).split("\n").length+" | "; if (area.getArea().getText().lastIndexOf("\n", area.getArea().getCaretPosition()) > 0) { lastp = area.getArea().getText(0, area.getArea().getCaretPosition()).lastIndexOf("\n"); text += "Character: " + (area.getArea().getCaretPosition() - lastp); } else { text += "Character: " + (area.getArea().getCaretPosition()+1); } linecurL.setText(text); Thread.sleep(10); }catch(Exception e){} } } } }.start(); } /** * 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() { topToolbar = new javax.swing.JToolBar(); filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0)); newB = new javax.swing.JButton(); filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); openB = new javax.swing.JButton(); saveB = new javax.swing.JButton(); cutB = new javax.swing.JButton(); copyB = new javax.swing.JButton(); pasteB = new javax.swing.JButton(); compileB = new javax.swing.JButton(); runB = new javax.swing.JButton(); jSeparator1 = new javax.swing.JToolBar.Separator(); fontSizeC = new javax.swing.JComboBox(); jSeparator2 = new javax.swing.JToolBar.Separator(); fontStyleC = new javax.swing.JComboBox(); jSeparator3 = new javax.swing.JToolBar.Separator(); langB = new javax.swing.JButton(); hmapB = new javax.swing.JButton(); jSeparator4 = new javax.swing.JToolBar.Separator(); findT = new javax.swing.JTextField(); jSeparator5 = new javax.swing.JToolBar.Separator(); findPB = new javax.swing.JButton(); findNB = new javax.swing.JButton(); jSeparator8 = new javax.swing.JToolBar.Separator(); showReplace = new javax.swing.JButton(); jSeparator6 = new javax.swing.JToolBar.Separator(); readUrlB = new javax.swing.JButton(); pbar = new javax.swing.JProgressBar(); jSeparator9 = new javax.swing.JToolBar.Separator(); aboutB = new javax.swing.JButton(); jSeparator10 = new javax.swing.JToolBar.Separator(); showOutputB = new javax.swing.JButton(); jSeparator7 = new javax.swing.JToolBar.Separator(); closeB = new javax.swing.JButton(); workArea = new javax.swing.JTabbedPane(); bottomContainer = new javax.swing.JPanel(); jToolBar2 = new javax.swing.JToolBar(); jLabel2 = new javax.swing.JLabel(); replaceWhatT = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); replaceWithT = new javax.swing.JTextField(); replaceB = new javax.swing.JButton(); replaceAllB = new javax.swing.JButton(); output = new javax.swing.JToolBar(); jTabbedPane1 = new javax.swing.JTabbedPane(); jScrollPane2 = new javax.swing.JScrollPane(); outputT = new javax.swing.JTextArea(); linecurL = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("My Editor"); setBounds(new java.awt.Rectangle(0, 0, 600, 0)); setIconImage(new ImageIcon(getClass().getResource("/img/logo.png")).getImage()); setMinimumSize(new java.awt.Dimension(600, 450)); topToolbar.setBorder(javax.swing.BorderFactory.createEtchedBorder(new java.awt.Color(204, 204, 255), null)); topToolbar.setFloatable(false); topToolbar.setRollover(true); topToolbar.add(filler1); newB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/newb.png"))); // NOI18N newB.setMnemonic('N'); newB.setToolTipText("Create new file (Alt+N)"); newB.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); newB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); newB.setFocusable(false); newB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); newB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); newB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { newBActionPerformed(evt); } }); topToolbar.add(newB); topToolbar.add(filler2); openB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/openb.png"))); // NOI18N openB.setMnemonic('O'); openB.setToolTipText("Open file (Alt+O)"); openB.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); openB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); openB.setFocusable(false); openB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); openB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); openB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { openBActionPerformed(evt); } }); topToolbar.add(openB); saveB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/saveb.png"))); // NOI18N saveB.setMnemonic('S'); saveB.setToolTipText("Save file (Alt+S)"); saveB.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); saveB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); saveB.setFocusable(false); saveB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); saveB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); saveB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { saveBActionPerformed(evt); } }); topToolbar.add(saveB); cutB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/cutb.png"))); // NOI18N cutB.setMnemonic('X'); cutB.setToolTipText("Cut (Alt+X)"); cutB.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); cutB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); cutB.setFocusable(false); cutB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); cutB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); cutB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cutBActionPerformed(evt); } }); topToolbar.add(cutB); copyB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/copyb.png"))); // NOI18N copyB.setMnemonic('C'); copyB.setToolTipText("Copy (Alt+C)"); copyB.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); copyB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); copyB.setFocusable(false); copyB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); copyB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); copyB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { copyBActionPerformed(evt); } }); topToolbar.add(copyB); pasteB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/pasteb.png"))); // NOI18N pasteB.setMnemonic('P'); pasteB.setToolTipText("Paste (Alt+P)"); pasteB.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); pasteB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); pasteB.setFocusable(false); pasteB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); pasteB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); pasteB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pasteBActionPerformed(evt); } }); topToolbar.add(pasteB); compileB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/compileb.png"))); // NOI18N compileB.setToolTipText("Compile"); compileB.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); compileB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); compileB.setFocusable(false); compileB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); compileB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); compileB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { compileBActionPerformed(evt); } }); topToolbar.add(compileB); runB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/runb.png"))); // NOI18N runB.setToolTipText("Run"); runB.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); runB.setFocusable(false); runB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); runB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); runB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { runBActionPerformed(evt); } }); topToolbar.add(runB); topToolbar.add(jSeparator1); fontSizeC.setEditable(true); fontSizeC.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "3", "7", "12", "16", "24", "28", "32", "36" })); fontSizeC.setSelectedItem(12); fontSizeC.setToolTipText("Font Size"); fontSizeC.setMaximumSize(new java.awt.Dimension(32767, 28)); fontSizeC.setMinimumSize(new java.awt.Dimension(93, 28)); fontSizeC.setPreferredSize(new java.awt.Dimension(98, 28)); fontSizeC.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { fontSizeCActionPerformed(evt); } }); topToolbar.add(fontSizeC); topToolbar.add(jSeparator2); fontStyleC.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Plain", "Bold", "Italic" })); fontStyleC.setToolTipText("Font Style"); fontStyleC.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); fontStyleC.setFocusable(false); fontStyleC.setMaximumSize(new java.awt.Dimension(32767, 28)); fontStyleC.setMinimumSize(new java.awt.Dimension(93, 28)); fontStyleC.setPreferredSize(new java.awt.Dimension(98, 28)); fontStyleC.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { fontStyleCActionPerformed(evt); } }); topToolbar.add(fontStyleC); topToolbar.add(jSeparator3); langB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/abc.png"))); // NOI18N langB.setToolTipText("English"); langB.setFocusable(false); langB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); langB.setMaximumSize(new java.awt.Dimension(29, 29)); langB.setMinimumSize(new java.awt.Dimension(29, 29)); langB.setPreferredSize(new java.awt.Dimension(29, 29)); langB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { langBActionPerformed(evt); } }); topToolbar.add(langB); hmapB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/map.png"))); // NOI18N hmapB.setToolTipText("Hindi Map"); hmapB.setEnabled(false); hmapB.setFocusable(false); hmapB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); hmapB.setMaximumSize(new java.awt.Dimension(29, 29)); hmapB.setMinimumSize(new java.awt.Dimension(29, 29)); hmapB.setPreferredSize(new java.awt.Dimension(29, 29)); hmapB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); hmapB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { hmapBActionPerformed(evt); } }); topToolbar.add(hmapB); topToolbar.add(jSeparator4); findT.setColumns(25); findT.setFont(new java.awt.Font("Nyala", 0, 18)); // NOI18N findT.setToolTipText("Find Text"); findT.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR)); findT.setMaximumSize(new java.awt.Dimension(2147483647, 28)); findT.setMinimumSize(new java.awt.Dimension(6, 28)); findT.setPreferredSize(new java.awt.Dimension(331, 28)); findT.addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { findTKeyReleased(evt); } }); topToolbar.add(findT); topToolbar.add(jSeparator5); findPB.setFont(new java.awt.Font("Segoe Script", 1, 24)); // NOI18N findPB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/fprevious.png"))); // NOI18N findPB.setToolTipText("Find Backward"); findPB.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); findPB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); findPB.setFocusable(false); findPB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); findPB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); findPB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { findPBActionPerformed(evt); } }); topToolbar.add(findPB); findNB.setFont(new java.awt.Font("Segoe Script", 1, 24)); // NOI18N findNB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/fnext.png"))); // NOI18N findNB.setToolTipText("Find Forward"); findNB.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); findNB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); findNB.setFocusable(false); findNB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); findNB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); findNB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { findNBActionPerformed(evt); } }); topToolbar.add(findNB); topToolbar.add(jSeparator8); showReplace.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/findreplaceb.png"))); // NOI18N showReplace.setMnemonic('H'); showReplace.setToolTipText("Replace (Alt+H)"); showReplace.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); showReplace.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); showReplace.setFocusable(false); showReplace.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); showReplace.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); showReplace.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { showReplaceActionPerformed(evt); } }); topToolbar.add(showReplace); topToolbar.add(jSeparator6); readUrlB.setFont(new java.awt.Font("Tahoma", 3, 12)); // NOI18N readUrlB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/urlreaderb.png"))); // NOI18N readUrlB.setMnemonic('U'); readUrlB.setToolTipText("Read Url (Alt+U)"); readUrlB.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); readUrlB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); readUrlB.setFocusable(false); readUrlB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); readUrlB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); readUrlB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { readUrlBActionPerformed(evt); } }); topToolbar.add(readUrlB); pbar.setValue(100); pbar.setMaximumSize(new java.awt.Dimension(50, 22)); pbar.setMinimumSize(new java.awt.Dimension(50, 22)); pbar.setPreferredSize(new java.awt.Dimension(50, 22)); pbar.setString("Reading"); topToolbar.add(pbar); topToolbar.add(jSeparator9); aboutB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/aboutb.png"))); // NOI18N aboutB.setToolTipText("About"); aboutB.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); aboutB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); aboutB.setFocusable(false); aboutB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); aboutB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); aboutB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { aboutBActionPerformed(evt); } }); topToolbar.add(aboutB); topToolbar.add(jSeparator10); showOutputB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/showhide.png"))); // NOI18N showOutputB.setToolTipText("Show/Hide Output"); showOutputB.setFocusable(false); showOutputB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); showOutputB.setMaximumSize(new java.awt.Dimension(29, 29)); showOutputB.setMinimumSize(new java.awt.Dimension(29, 29)); showOutputB.setPreferredSize(new java.awt.Dimension(29, 29)); showOutputB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); showOutputB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { showOutputBActionPerformed(evt); } }); topToolbar.add(showOutputB); topToolbar.add(jSeparator7); closeB.setFont(new java.awt.Font("Ebrima", 1, 22)); // NOI18N closeB.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/closeb.png"))); // NOI18N closeB.setMnemonic('E'); closeB.setToolTipText("Close (Alt+E)"); closeB.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); closeB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); closeB.setFocusable(false); closeB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); closeB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); closeB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { closeBActionPerformed(evt); } }); topToolbar.add(closeB); getContentPane().add(topToolbar, java.awt.BorderLayout.NORTH); workArea.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); workArea.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { workAreaMouseClicked(evt); } }); getContentPane().add(workArea, java.awt.BorderLayout.CENTER); bottomContainer.setLayout(new java.awt.BorderLayout()); jToolBar2.setBorder(javax.swing.BorderFactory.createEtchedBorder(new java.awt.Color(204, 204, 255), null)); jToolBar2.setFloatable(false); jToolBar2.setRollover(true); jToolBar2.setPreferredSize(new java.awt.Dimension(227, 23)); jLabel2.setText(" What: "); jToolBar2.add(jLabel2); replaceWhatT.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N replaceWhatT.setMinimumSize(new java.awt.Dimension(6, 26)); replaceWhatT.setPreferredSize(new java.awt.Dimension(6, 10)); jToolBar2.add(replaceWhatT); jLabel1.setText(" Replace with: "); jToolBar2.add(jLabel1); replaceWithT.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N replaceWithT.setMinimumSize(new java.awt.Dimension(6, 26)); jToolBar2.add(replaceWithT); replaceB.setText("Replace"); replaceB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); replaceB.setFocusable(false); replaceB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); replaceB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); replaceB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { replaceBActionPerformed(evt); } }); jToolBar2.add(replaceB); replaceAllB.setText("Replace All"); replaceAllB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); replaceAllB.setFocusable(false); replaceAllB.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); replaceAllB.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM); replaceAllB.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { replaceAllBActionPerformed(evt); } }); jToolBar2.add(replaceAllB); bottomContainer.add(jToolBar2, java.awt.BorderLayout.NORTH); jToolBar2.setVisible(false); output.setFloatable(false); output.setRollover(true); output.setToolTipText("Output"); output.setMaximumSize(new java.awt.Dimension(32780, 100)); output.setName("Output"); // NOI18N output.setPreferredSize(new java.awt.Dimension(113, 100)); outputT.setColumns(20); outputT.setRows(5); jScrollPane2.setViewportView(outputT); jTabbedPane1.addTab("Output", jScrollPane2); output.add(jTabbedPane1); bottomContainer.add(output, java.awt.BorderLayout.CENTER); linecurL.setText("Total Line: 50; Current Line: 25; Character: 10;"); bottomContainer.add(linecurL, java.awt.BorderLayout.PAGE_END); getContentPane().add(bottomContainer, java.awt.BorderLayout.PAGE_END); pack(); }// </editor-fold> private void openBActionPerformed(java.awt.event.ActionEvent evt) { JFileChooser jfc = new JFileChooser(); int response = jfc.showOpenDialog(this); if (response == JFileChooser.APPROVE_OPTION) { try { file = jfc.getSelectedFile();//future check FileInputStream fis = new FileInputStream(file); byte b[] = new byte[fis.available()]; fis.read(b); String str = new String(b); area = new Area(); area.setFont("Aerial", fontStyleC.getSelectedIndex(), Integer.parseInt(String.valueOf(fontSizeC.getSelectedItem()))); area.getArea().setText(str); String name = file.toString(); addTab(name, area); area.setEdited(false); area.setSaved(true); } catch (Exception e) { JOptionPane.showMessageDialog(this, "File Cannot Open"); } } } private void newBActionPerformed(java.awt.event.ActionEvent evt) { area = new Area(); area.setFont("Aerial", fontStyleC.getSelectedIndex(), Integer.parseInt(String.valueOf(fontSizeC.getSelectedItem()))); addTab("Untitled", area); } private void aboutBActionPerformed(java.awt.event.ActionEvent evt) { visible = !visible; aboutWin.setLocation(-aboutWin.getWidth() / 2 + this.getWidth() / 2, this.getY() - aboutWin.getHeight() / 2 + this.getHeight() / 2); aboutWin.setVisible(visible); } private void saveBActionPerformed(java.awt.event.ActionEvent evt) { save(); } private void closeBActionPerformed(java.awt.event.ActionEvent evt) { area = (Area) workArea.getSelectedComponent(); if (area != null) { if (area.isEdited()) { int response = JOptionPane.showConfirmDialog(rootPane, "Do you want to Save Changes"); if (JOptionPane.YES_OPTION == response) { save(); workArea.removeTabAt(workArea.getSelectedIndex()); } else if (JOptionPane.NO_OPTION == response) { workArea.removeTabAt(workArea.getSelectedIndex()); } } else { workArea.removeTabAt(workArea.getSelectedIndex()); } } else { JOptionPane.showMessageDialog(rootPane, "There is no any opened document!"); } } private void cutBActionPerformed(java.awt.event.ActionEvent evt) { area = (Area) workArea.getSelectedComponent(); area.getArea().cut(); } private void copyBActionPerformed(java.awt.event.ActionEvent evt) { area = (Area) workArea.getSelectedComponent(); area.getArea().copy(); } private void pasteBActionPerformed(java.awt.event.ActionEvent evt) { area = (Area) workArea.getSelectedComponent(); area.getArea().paste(); } private void findNBActionPerformed(java.awt.event.ActionEvent evt) { find(findT.getText(), pos, 1); } private void findPBActionPerformed(java.awt.event.ActionEvent evt) { find(findT.getText(), pos, -1); } private void workAreaMouseClicked(java.awt.event.MouseEvent evt) { area = (Area) workArea.getSelectedComponent(); String size = String.valueOf(area.getFont().getSize()); fontStyleC.setSelectedIndex(area.getFont().getStyle()); fontSizeC.setSelectedItem(size); } private void findTKeyReleased(java.awt.event.KeyEvent evt) { if (area.isHindi()) { area.getArea().getHighlighter().removeAllHighlights(); findAll(Translator.toHindi(findT.getText()), 0); } else { area.getArea().getHighlighter().removeAllHighlights(); findAll(findT.getText(), 0); } } private void readUrlBActionPerformed(java.awt.event.ActionEvent evt) { new Thread() { @Override public void run() { try { String path = JOptionPane.showInputDialog("Enter Url"); if (!path.startsWith("http://")) { path = "http://" + path; } new Thread() { @Override public void run() { int i = 0; pbar.setStringPainted(true); while (!taskDone) { if (i == 100) { i = 0; } pbar.setValue(i); i += 5; try { Thread.sleep(50); } catch (InterruptedException e) { } } pbar.setValue(100); pbar.setStringPainted(false); taskDone = false; } }.start(); URL url = new URL(path); BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream())); String read = null; String content = ""; while ((read = br.readLine()) != null) { content = content + read + "\n"; } br.close(); area = new Area(); area.getArea().setText(content); workArea.addTab(url.toString(), area); workArea.setSelectedIndex(workArea.getTabCount() - 1); taskDone = true; } catch (Exception ex) { taskDone = true; JOptionPane.showMessageDialog(null, ex); } } }.start(); } private void showReplaceActionPerformed(java.awt.event.ActionEvent evt) { visible = !visible; jToolBar2.setVisible(visible); replaceWhatT.setText(findT.getText()); } private void replaceBActionPerformed(java.awt.event.ActionEvent evt) { String string = area.getArea().getText(); string = string.replaceFirst(replaceWhatT.getText(), replaceWithT.getText()); area.getArea().setText(string); } private void replaceAllBActionPerformed(java.awt.event.ActionEvent evt) { String string = area.getArea().getText(); string = string.replaceAll(replaceWhatT.getText(), replaceWithT.getText()); area.getArea().setText(string); } private void fontSizeCActionPerformed(java.awt.event.ActionEvent evt) { try { int size = Integer.parseInt(String.valueOf(fontSizeC.getSelectedItem())); int style = fontStyleC.getSelectedIndex(); area.setFont("Aerial", style, size); } catch (Exception e) { fontSizeC.setSelectedIndex(2); } } private void fontStyleCActionPerformed(java.awt.event.ActionEvent evt) { int size = Integer.parseInt((String.valueOf(fontSizeC.getSelectedItem()))); int style = fontStyleC.getSelectedIndex(); area.setFont("Aerial", style, size); } private void compileBActionPerformed(java.awt.event.ActionEvent evt) { try { save(); if (area.isSaved()) { if(workArea.getTitleAt(workArea.getSelectedIndex()).lastIndexOf(".java")>0){ Runtime runtime = Runtime.getRuntime(); runtime.exec("javac " + workArea.getTitleAt(workArea.getSelectedIndex())); outputT.setText("Compiled Successfully"); }else{ outputT.setText("File Should be of .java extension"); } } else { outputT.setText("Cannot compile unsaved file"); } } catch (Exception ex) { outputT.setText("Error in Compilation! " + ex); } } private void runBActionPerformed(java.awt.event.ActionEvent evt) { save(); new Thread() { @Override public void run() { try { Runtime rt = Runtime.getRuntime(); String location = workArea.getTitleAt(workArea.getSelectedIndex()); String fl = location.substring(location.lastIndexOf("\\") + 1, location.lastIndexOf(".")); location = location.substring(0, location.lastIndexOf("\\")); Process pr = rt.exec("java -classpath \"" + location + "\" " + fl); BufferedReader br = new BufferedReader(new InputStreamReader(pr.getInputStream())); String line; outputT.setText(""); while ((line = br.readLine()) != null) { outputT.setText(outputT.getText() + line + "\n"); } } catch (IOException ex) { outputT.setText(ex.toString()); } } }.start(); } private void langBActionPerformed(java.awt.event.ActionEvent evt) { if (area.isHindi()) { langB.setToolTipText("English"); area.setHindi(false); hmapB.setEnabled(false); langB.setIcon(new ImageIcon(getClass().getResource("/img/abc.png"))); } else { langB.setToolTipText("Hindi"); area.setHindi(true); hmapB.setEnabled(true); langB.setIcon(new ImageIcon(getClass().getResource("/img/a.png"))); } } private void hmapBActionPerformed(java.awt.event.ActionEvent evt) { if (hMap == null) { hMap = new HindiMap(); } if (hMap.isVisible()) { hMap.setVisible(false); } else { hMap.setVisible(true); } } private void showOutputBActionPerformed(java.awt.event.ActionEvent evt) { if (output.isVisible()) { output.setVisible(false); } else { output.setVisible(true); } } public void find(String search, int pos, int d) { area.getArea().getHighlighter().removeAllHighlights(); if (d == 1) { pos = area.getArea().getText().replaceAll("\n", "").indexOf(search, pos); }//replaceAll to remove new lines character if (d == -1) { pos = area.getArea().getText().replaceAll("\n", "").lastIndexOf(search, pos); } if (pos >= 0) { try { Highlighter h = area.getArea().getHighlighter(); h.addHighlight(pos, pos + search.length(), new DefaultHighlighter.DefaultHighlightPainter(Color.GREEN)); } catch (Exception ex) { JOptionPane.showMessageDialog(area.getArea(), ex); } if (d == -1) { this.pos = pos - search.length(); } if (d == 1) { this.pos = pos + search.length(); } } } public void findAll(String search, int pos) { pos = area.getArea().getText().replaceAll("\n", "").indexOf(search, pos);//replaceAll to remove new lines character if (pos >= 0 && search.length() > 0) { try { Highlighter h = area.getArea().getHighlighter(); h.addHighlight(pos, pos + search.length(), new DefaultHighlighter.DefaultHighlightPainter(Color.GREEN)); } catch (Exception ex) { JOptionPane.showMessageDialog(area.getArea(), ex); } pos += search.length(); if (pos < area.getArea().getText().length()) { findAll(search, pos); }//recursion } } public void save() { JFileChooser jfc = new JFileChooser(); area = (Area) workArea.getSelectedComponent(); if (!area.isSaved()) { int response = jfc.showSaveDialog(this); if (response == JFileChooser.APPROVE_OPTION) { file = jfc.getSelectedFile(); if (file.exists()) { response = JOptionPane.showConfirmDialog(this, "File allready exists, Dou you want to overrite"); if (response == JOptionPane.YES_OPTION) { write(area); } else if (response == JOptionPane.NO_OPTION) { save(); } } else if (!file.exists()) { write(area); } area.setSaved(true); } } else { write(area); } } private void write(Area area) { try { String str = area.getArea().getText(); pw = new PrintWriter(new FileOutputStream(file)); pw.write(str); pw.flush(); String name = file.toString(); //name = name.substring(name.lastIndexOf("\\") + 1, name.length()); workArea.setTitleAt(workArea.getSelectedIndex(), name); area.setEdited(false); } catch (Exception e) { JOptionPane.showMessageDialog(this, "Cannot Save"); } } private void addTab(String title, Area area) { workArea.addTab(title, area); workArea.setSelectedIndex(workArea.getTabCount() - 1); } boolean taskDone = false; boolean running = true; private HindiMap hMap; private PrintWriter pw; private File file; private Area area; private int pos; private boolean visible; private About aboutWin = new About(); boolean closeAll = false; // Variables declaration - do not modify private javax.swing.JButton aboutB; private javax.swing.JPanel bottomContainer; private javax.swing.JButton closeB; private javax.swing.JButton compileB; private javax.swing.JButton copyB; private javax.swing.JButton cutB; private javax.swing.Box.Filler filler1; private javax.swing.Box.Filler filler2; private javax.swing.JButton findNB; private javax.swing.JButton findPB; private javax.swing.JTextField findT; private javax.swing.JComboBox fontSizeC; private javax.swing.JComboBox fontStyleC; private javax.swing.JButton hmapB; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JToolBar.Separator jSeparator1; private javax.swing.JToolBar.Separator jSeparator10; private javax.swing.JToolBar.Separator jSeparator2; private javax.swing.JToolBar.Separator jSeparator3; private javax.swing.JToolBar.Separator jSeparator4; private javax.swing.JToolBar.Separator jSeparator5; private javax.swing.JToolBar.Separator jSeparator6; private javax.swing.JToolBar.Separator jSeparator7; private javax.swing.JToolBar.Separator jSeparator8; private javax.swing.JToolBar.Separator jSeparator9; private javax.swing.JTabbedPane jTabbedPane1; private javax.swing.JToolBar jToolBar2; private javax.swing.JButton langB; private javax.swing.JLabel linecurL; private javax.swing.JButton newB; private javax.swing.JButton openB; private javax.swing.JToolBar output; private javax.swing.JTextArea outputT; private javax.swing.JButton pasteB; private javax.swing.JProgressBar pbar; private javax.swing.JButton readUrlB; private javax.swing.JButton replaceAllB; private javax.swing.JButton replaceB; private javax.swing.JTextField replaceWhatT; private javax.swing.JTextField replaceWithT; private javax.swing.JButton runB; private javax.swing.JButton saveB; private javax.swing.JButton showOutputB; private javax.swing.JButton showReplace; private javax.swing.JToolBar topToolbar; private javax.swing.JTabbedPane workArea; // End of variables declaration @Override public void windowOpened(WindowEvent e) { } @Override public void windowClosing(WindowEvent e) { closeAll = true; running = false; } @Override public void windowClosed(WindowEvent e) { System.exit(0); } @Override public void windowIconified(WindowEvent e) { } @Override public void windowDeiconified(WindowEvent e) { } @Override public void windowActivated(WindowEvent e) { } @Override public void windowDeactivated(WindowEvent e) { } } |
HindiMap.java
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
package jeditor; import javax.swing.table.TableModel; /** * * @author Rajesh Kumar Sahanee */ public class HindiMap extends javax.swing.JFrame { /** * Creates new form HindiMap */ public HindiMap() { initComponents(); initializeMap(); } private void initializeMap(){ TableModel tm = mapTable.getModel(); tm.setValueAt(Translator.toHindi("a"), 0, 0); tm.setValueAt("a/A", 0, 1); tm.setValueAt(Translator.toHindi("aa"), 0, 2); tm.setValueAt("aa", 0, 3); tm.setValueAt(Translator.toHindi("i"), 0, 4); tm.setValueAt("i", 0, 5); tm.setValueAt(Translator.toHindi("ee"), 0, 6); tm.setValueAt("ee/I", 0, 7); tm.setValueAt(Translator.toHindi("u"), 0, 8); tm.setValueAt("u", 0, 9); tm.setValueAt(Translator.toHindi("uu"), 1, 0); tm.setValueAt("uu/oo/U", 1, 1); tm.setValueAt(Translator.toHindi("RRi"), 1, 2); tm.setValueAt("RRi", 1, 3); tm.setValueAt(Translator.toHindi("e"), 1, 4); tm.setValueAt("e", 1, 5); tm.setValueAt(Translator.toHindi("ai"), 1, 6); tm.setValueAt("ai", 1, 7); tm.setValueAt(Translator.toHindi("o"), 1, 8); tm.setValueAt("o", 1, 9); tm.setValueAt(Translator.toHindi("au"), 2, 0); tm.setValueAt("au/ou", 2, 1); tm.setValueAt(Translator.toHindi("aM"), 2, 2); tm.setValueAt("aM", 2, 3); tm.setValueAt(Translator.toHindi("aH"), 2, 4); tm.setValueAt("aH", 2, 5); tm.setValueAt(Translator.toHindi(".n"), 3, 0); tm.setValueAt(".n", 3, 1); tm.setValueAt(Translator.toHindi(".N"), 3, 2); tm.setValueAt(".N", 3, 3); tm.setValueAt(Translator.toHindi(".h"), 3, 4); tm.setValueAt(".h", 3, 5); tm.setValueAt(Translator.toHindi("k")+"/"+Translator.toHindi("ka"), 4, 0); tm.setValueAt("k/ka", 4, 1); tm.setValueAt(Translator.toHindi("kh")+"/"+Translator.toHindi("kha"), 4, 2); tm.setValueAt("kh/kha", 4, 3); tm.setValueAt(Translator.toHindi("g")+"/"+Translator.toHindi("ga"), 4, 4); tm.setValueAt("g/ga", 4, 5); tm.setValueAt(Translator.toHindi("gh")+"/"+Translator.toHindi("gha"), 4, 6); tm.setValueAt("gh/gha", 4, 7); tm.setValueAt(Translator.toHindi("~N"), 4, 8); tm.setValueAt("~N", 4, 9); tm.setValueAt(Translator.toHindi("ch")+"/"+Translator.toHindi("cha"), 5, 0); tm.setValueAt("ch/cha", 5, 1); tm.setValueAt(Translator.toHindi("chh")+"/"+Translator.toHindi("chha"), 5, 2); tm.setValueAt("chh/chha", 5, 3); tm.setValueAt(Translator.toHindi("j")+"/"+Translator.toHindi("ja"), 5, 4); tm.setValueAt("j/ja", 5, 5); tm.setValueAt(Translator.toHindi("jh")+"/"+Translator.toHindi("jha"), 5, 6); tm.setValueAt("jh/jha", 5, 7); tm.setValueAt(Translator.toHindi("~n"), 5, 8); tm.setValueAt("~n", 5, 9); tm.setValueAt(Translator.toHindi("T")+"/"+Translator.toHindi("Ta"), 6, 0); tm.setValueAt("T/Ta", 6, 1); tm.setValueAt(Translator.toHindi("Th")+"/"+Translator.toHindi("Tha"), 6, 2); tm.setValueAt("Th/Tha", 6, 3); tm.setValueAt(Translator.toHindi("D")+"/"+Translator.toHindi("Da"), 6, 4); tm.setValueAt("D/Da", 6, 5); tm.setValueAt(Translator.toHindi("Dh")+"/"+Translator.toHindi("Dha"), 6, 6); tm.setValueAt("Dh/Dha", 6, 7); tm.setValueAt(Translator.toHindi("N")+"/"+Translator.toHindi("Na"), 6, 8); tm.setValueAt("N/Na", 6, 9); tm.setValueAt(Translator.toHindi("t")+"/"+Translator.toHindi("ta"), 7, 0); tm.setValueAt("t/ta", 7, 1); tm.setValueAt(Translator.toHindi("th")+"/"+Translator.toHindi("tha"), 7, 2); tm.setValueAt("th/tha", 7, 3); tm.setValueAt(Translator.toHindi("d")+"/"+Translator.toHindi("da"), 7, 4); tm.setValueAt("d/da", 7, 5); tm.setValueAt(Translator.toHindi("dh")+"/"+Translator.toHindi("dha"), 7, 6); tm.setValueAt("dh/dha", 7, 7); tm.setValueAt(Translator.toHindi("n")+"/"+Translator.toHindi("na"), 7, 8); tm.setValueAt("n/na", 7, 9); tm.setValueAt(Translator.toHindi("p")+"/"+Translator.toHindi("pa"), 8, 0); tm.setValueAt("p/pa", 8, 1); tm.setValueAt(Translator.toHindi("ph")+"/"+Translator.toHindi("pha"), 8, 2); tm.setValueAt("ph/pha", 8, 3); tm.setValueAt(Translator.toHindi("b")+"/"+Translator.toHindi("ba"), 8, 4); tm.setValueAt("b/ba", 8, 5); tm.setValueAt(Translator.toHindi("bh")+"/"+Translator.toHindi("bha"), 8, 6); tm.setValueAt("bh/bha", 8, 7); tm.setValueAt(Translator.toHindi("m"), 8, 8); tm.setValueAt("m", 8, 9); tm.setValueAt(Translator.toHindi("y")+"/"+Translator.toHindi("ya"), 9, 0); tm.setValueAt("y/ya", 9, 1); tm.setValueAt(Translator.toHindi("r")+"/"+Translator.toHindi("ra"), 9, 2); tm.setValueAt("r/ra", 9, 3); tm.setValueAt(Translator.toHindi("l")+"/"+Translator.toHindi("la"), 9, 4); tm.setValueAt("l/la", 9, 5); tm.setValueAt(Translator.toHindi("v")+"/"+Translator.toHindi("va"), 9, 6); tm.setValueAt("(v/w)/(va/wa)", 9, 7); tm.setValueAt(Translator.toHindi("sh")+"/"+Translator.toHindi("sha"), 10, 0); tm.setValueAt("sh/sha", 10, 1); tm.setValueAt(Translator.toHindi("shh")+"/"+Translator.toHindi("shha"), 10, 2); tm.setValueAt("shh/shha", 10, 3); tm.setValueAt(Translator.toHindi("s")+"/"+Translator.toHindi("sa"), 10, 4); tm.setValueAt("s/sa", 10, 5); tm.setValueAt(Translator.toHindi("h")+"/"+Translator.toHindi("ha"), 10, 6); tm.setValueAt("h/ha", 10, 7); tm.setValueAt(Translator.toHindi("L"), 10, 8); tm.setValueAt("L", 10, 9); tm.setValueAt(Translator.toHindi("kSh"), 11, 0); tm.setValueAt("kSh", 11, 1); tm.setValueAt(Translator.toHindi("tr")+"/"+Translator.toHindi("tra"), 11, 2); tm.setValueAt("tr/tra", 11, 3); tm.setValueAt(Translator.toHindi("GY")+"/"+Translator.toHindi("GYa"), 11, 4); tm.setValueAt("GY/GYa", 11, 5); tm.setValueAt(Translator.toHindi("shr")+"/"+Translator.toHindi("shra"), 11, 6); tm.setValueAt("shr/shra", 11, 7); mapTable.setModel(tm); mapTable.updateUI(); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { mainContainer = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); mapTable = new javax.swing.JTable(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Hindi Map"); setResizable(false); mapTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {"", null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null, null, null} }, new String [] { "HIN", "ENG", "HIN", "ENG", "HIN", "ENG", "HIN", "ENG", "HIN", "ENG" } )); mapTable.setSelectionBackground(new java.awt.Color(204, 204, 204)); mapTable.setShowHorizontalLines(false); mapTable.getTableHeader().setReorderingAllowed(false); jScrollPane1.setViewportView(mapTable); javax.swing.GroupLayout mainContainerLayout = new javax.swing.GroupLayout(mainContainer); mainContainer.setLayout(mainContainerLayout); mainContainerLayout.setHorizontalGroup( mainContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainContainerLayout.createSequentialGroup() .addGap(0, 0, 0) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 603, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) ); mainContainerLayout.setVerticalGroup( mainContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(mainContainerLayout.createSequentialGroup() .addGap(0, 0, 0) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 267, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) ); getContentPane().add(mainContainer, java.awt.BorderLayout.LINE_END); pack(); }// </editor-fold> // Variables declaration - do not modify private javax.swing.JScrollPane jScrollPane1; private javax.swing.JPanel mainContainer; private javax.swing.JTable mapTable; // End of variables declaration } |
Translator.java
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
package jeditor; import java.io.UnsupportedEncodingException; /** * * @author Rajesh Kumar Sahanee */ public class Translator { public static String toEnglish(String hindi) { String english = hindi; if (english != null) { english = english.replaceAll("\u0915\u094D\u0937","kSh"); english = english.replaceAll("\u091C\u094D\u091E\u093E","GYa"); english = english.replaceAll("\u091C\u094D\u091E","GY"); english = english.replaceAll("\u0902",".n"); english = english.replaceAll("\u0901",".N"); english = english.replaceAll("\u0903",".h"); english = english.replaceAll("\u0916", "kh"); english = english.replaceAll("\u0915", "k"); english = english.replaceAll("\u0918", "gh"); english = english.replaceAll("\u0917", "g"); english = english.replaceAll("\u0919", "~N"); english = english.replaceAll("\u091B", "chh"); english = english.replaceAll("\u091A", "ch"); english = english.replaceAll("\u091D", "jh"); english = english.replaceAll("\u091C", "j"); english = english.replaceAll("\u091E", "~n"); english = english.replaceAll("\u0920", "Th"); english = english.replaceAll("\u091F", "T"); english = english.replaceAll("\u0922", "Dh"); english = english.replaceAll("\u0921", "D"); english = english.replaceAll("\u0923", "N"); english = english.replaceAll("\u0925", "th"); english = english.replaceAll("\u0924", "t"); english = english.replaceAll("\u0927", "dh"); english = english.replaceAll("\u0926", "d"); english = english.replaceAll("\u0928", "n"); english = english.replaceAll("\u092B", "ph"); english = english.replaceAll("\u092A", "p"); english = english.replaceAll("\u092D", "bh"); english = english.replaceAll("\u092C", "b"); english = english.replaceAll("\u092E", "m"); english = english.replaceAll("\u092F", "y"); english = english.replaceAll("\u0930", "r"); english = english.replaceAll("\u0932", "l"); english = english.replaceAll("\u0923", "L"); english = english.replaceAll("\u0935", "v"); english = english.replaceAll("\u0935", "w"); english = english.replaceAll("\u0937", "shh"); english = english.replaceAll("\u0936", "sh"); english = english.replaceAll("\u0938", "s"); english = english.replaceAll("\u0939", "h"); english = english.replaceAll("\u094D", "`"); english = english.replaceAll("\u0906", "AA"); english = english.replaceAll("\u0948", "ai"); english = english.replaceAll("\u0910", "AI"); english = english.replaceAll("\u093F", "i"); english = english.replaceAll("\u0907", "I"); english = english.replaceAll("\u0940", "ee"); english = english.replaceAll("\u0908", "EE"); english = english.replaceAll("\u0941", "u"); english = english.replaceAll("\u0909", "U"); english = english.replaceAll("\u0942", "oo"); english = english.replaceAll("\u090A", "OO"); english = english.replaceAll("\u090B", "RRi"); english = english.replaceAll("\u090C", "LLi"); english = english.replaceAll("\u0947", "e"); english = english.replaceAll("\u090F", "E"); english = english.replaceAll("\u094B", "o"); english = english.replaceAll("\u0913", "O"); english = english.replaceAll("\u094C", "au"); english = english.replaceAll("\u0914", "AU"); english = english.replaceAll("\u0905\u0902", "aM"); english = english.replaceAll("\u0905\u0903", "aH"); english = english.replaceAll("\u093E", "a"); english = english.replaceAll("\u0905", "A"); } return english; } public static String toHindi(String english) { String hindi = toEnglish(english); if (hindi != null) { hindi = hindi.replaceAll("kSha","\u0915\u094D\u0937\u093E"); hindi = hindi.replaceAll("kSh","\u0915\u094D\u0937"); hindi = hindi.replaceAll("GYa","\u091C\u094D\u091E\u093E"); hindi = hindi.replaceAll("GY","\u091C\u094D\u091E"); hindi = hindi.replaceAll("kh", "\u0916"); hindi = hindi.replaceAll("k", "\u0915"); hindi = hindi.replaceAll("gh", "\u0918\u094D"); hindi = hindi.replaceAll("g", "\u0917"); hindi = hindi.replaceAll("~N", "\u0919"); hindi = hindi.replaceAll("chh", "\u091B"); hindi = hindi.replaceAll("ch", "\u091A"); hindi = hindi.replaceAll("jh", "\u091D"); hindi = hindi.replaceAll("j", "\u091C"); hindi = hindi.replaceAll("~n", "\u091E"); hindi = hindi.replaceAll("Th", "\u0920"); hindi = hindi.replaceAll("T", "\u091F"); hindi = hindi.replaceAll("Dh", "\u0922"); hindi = hindi.replaceAll("D", "\u0921"); hindi = hindi.replaceAll("th", "\u0925"); hindi = hindi.replaceAll("t", "\u0924"); hindi = hindi.replaceAll("dh", "\u0927"); hindi = hindi.replaceAll("d", "\u0926"); //hindi = hindi.replaceAll("n", "\u0928"); hindi = hindi.replaceAll("ph", "\u092B"); hindi = hindi.replaceAll("f", "\u092B"); hindi = hindi.replaceAll("p", "\u092A"); hindi = hindi.replaceAll("bh", "\u092D"); hindi = hindi.replaceAll("b", "\u092C"); hindi = hindi.replaceAll("m", "\u092E"); hindi = hindi.replaceAll("y", "\u092F"); hindi = hindi.replaceAll("r", "\u0930"); //hindi = hindi.replaceAll("RRA", "\u0931"); hindi = hindi.replaceAll("l", "\u0932"); hindi = hindi.replaceAll("L", "\u0933"); //hindi = hindi.replaceAll("LLLA", "\u0934"); hindi = hindi.replaceAll("v", "\u0935"); hindi = hindi.replaceAll("w", "\u0935"); hindi = hindi.replaceAll("shh", "\u0937"); hindi = hindi.replaceAll("sh", "\u0936"); hindi = hindi.replaceAll("s", "\u0938"); hindi = hindi.replaceAll("\\.n", "\u0902"); hindi = hindi.replaceAll("\\.N", "\u0901"); hindi = hindi.replaceAll("\\.h", "\u0903"); hindi = hindi.replaceAll("n", "\u0928"); hindi = hindi.replaceAll("N", "\u0923"); hindi = hindi.replaceAll("h", "\u0939"); hindi = hindi.replaceAll("`", "\u094D"); hindi = hindi.replaceAll("AA", "\u0906"); hindi = hindi.replaceAll("ai", "\u0948"); hindi = hindi.replaceAll("AI", "\u0910"); hindi = hindi.replaceAll("ee", "\u0940"); hindi = hindi.replaceAll("EE", "\u0908"); hindi = hindi.replaceAll("oo", "\u0942"); hindi = hindi.replaceAll("OO", "\u090A"); hindi = hindi.replaceAll("RRi", "\u090B"); hindi = hindi.replaceAll("Ri", "\u0943"); hindi = hindi.replaceAll("LLi", "\u090C"); hindi = hindi.replaceAll("i", "\u093F"); hindi = hindi.replaceAll("I", "\u0907"); hindi = hindi.replaceAll("e", "\u0947"); hindi = hindi.replaceAll("E", "\u090F"); hindi = hindi.replaceAll("au", "\u094C"); hindi = hindi.replaceAll("AU", "\u0914"); hindi = hindi.replaceAll("ou", "\u094C"); hindi = hindi.replaceAll("OU", "\u0914"); hindi = hindi.replaceAll("u", "\u0941"); hindi = hindi.replaceAll("U", "\u0909"); hindi = hindi.replaceAll("o", "\u094B"); hindi = hindi.replaceAll("O", "\u0913"); hindi = hindi.replaceAll("aM", "\u0905\u0902"); hindi = hindi.replaceAll("aH", "\u0905\u0903"); hindi = hindi.replaceAll("a", "\u093E"); hindi = hindi.replaceAll("A", "\u0905"); } try { return new String(hindi.getBytes("UTF-8")); } catch (UnsupportedEncodingException ex) { return null; } catch (NullPointerException ex) { return null; } } } |
About.java
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
package jeditor; /** * * @author Rajesh Kumar Sahanee */ public class About extends javax.swing.JFrame { /** Creates new form sprite */ public About() { 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() { jPanel2 = new javax.swing.JPanel(); jLabel6 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setAlwaysOnTop(true); setBackground(new java.awt.Color(255, 204, 204)); setLocationByPlatform(true); setUndecorated(true); jPanel2.setBackground(new java.awt.Color(153, 0, 153)); jLabel6.setForeground(new java.awt.Color(204, 204, 255)); jLabel6.setText("java files but you can"); jLabel3.setForeground(new java.awt.Color(153, 153, 255)); jLabel3.setText("Description:"); jLabel4.setForeground(new java.awt.Color(204, 204, 255)); jLabel4.setText("This Editor is designed"); jLabel5.setForeground(new java.awt.Color(204, 204, 255)); jLabel5.setText("to edit or create new"); jLabel7.setForeground(new java.awt.Color(204, 204, 255)); jLabel7.setText("also create and edit"); jLabel1.setForeground(new java.awt.Color(204, 204, 255)); jLabel1.setText("JEditor 1.0.0"); jLabel2.setForeground(new java.awt.Color(204, 0, 255)); jLabel2.setText("Developed by Rajesh Kumar Sahanee"); jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/logo.gif"))); // NOI18N jLabel8.setForeground(new java.awt.Color(204, 204, 255)); jLabel8.setText("other files too"); 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) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(4, 4, 4) .addComponent(jLabel1)) .addComponent(jLabel2)) .addGap(15, 15, 15)) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel9) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, Short.MAX_VALUE))))) .addContainerGap()) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(2, 2, 2) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(2, 2, 2) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(2, 2, 2) .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel9)) .addGap(2, 2, 2) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE) .addContainerGap()) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); }// </editor-fold> /** * @param args the command line arguments */ // Variables declaration - do not modify private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; 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 jPanel2; // End of variables declaration } |
Output/Screenshot
Download NetBeans Project
Text Editor in Java
1 file(s) 136.17 KB
Thanks
Comments