اريد ان ا قوم بمشروع لحل مشكلة اللغة العربية كما تعرفون في معظم البرامج هناك مشاكل مع اللغة العربية ولكن اذا قمنا بتحويل الحرف الى الرمز الرديف له فاننا نحل المشكلة ووجدت هذا البرنامج في Sun Forum وهو يكتب فقط يعني تماما يحول الاحرف الى العربية يمكنك تجربته وعن طؤيق تحويله مثلا اضافة زر وعمل Save بحيث يكتب ما قمت بعمله ولكن بارمز الرديف له حتى يتم قرائة الملف اينما تريد بلا مشاكل واريد اقتراحات منكم :
/*
* arabicTextArea.java
*
* Created on 23 de Novembro de 2004, 4:55
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;
/**
*
* @author naberus.br
*/
public class arabicTextArea extends javax.swing.JFrame {
public arabicTextArea() {
initComponents();
}
private void initComponents() {
jPanel2 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
getContentPane().setLayout(new BorderLayout());
setTitle("Arabic JTextArea");
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
exitForm(evt);
}
});
jPanel2.setLayout(new BorderLayout());
jPanel2.setBorder(new javax.swing.border.EtchedBorder());
jTextArea1.setComponentOrientation(java.awt.ComponentOrientation.RIGHT_TO
_LEFT);
jTextArea1.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
jTexArea1KeyTyped(evt);
}
});
jTextArea1.setLineWrap(true);
Keymap parent = jTextArea1.getKeymap();
Keymap arabic = jTextArea1.addKeymap("Arabic", parent);
JTextComponent.loadKeymap( arabic, arabicBindings, arabicActions );
TextAction a = new InsertMeAction("Arabic");
jTextArea1.setFont(new Font("Arial", Font.BOLD, 16));
jTextArea1.setKeymap(arabic);
jScrollPane1.setViewportView(jTextArea1);
jPanel2.add(jScrollPane1);
jScrollPane1.setBounds(0, 0, 700, 310);
getContentPane().add(jPanel2);
jPanel2.setBounds(0, 220, 700, 310);
pack();
}
private void jTexArea1KeyTyped(java.awt.event.KeyEvent evt) {
jTextArea1.repaint();
}
static final JTextComponent.KeyBinding[] arabicBindings = {
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(';'),
"insert-me \u0638"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(':'),
"insert-me \u061F"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('.'),
"insert-me \u0630"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('>'),
"insert-me \u0630"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke(','),
"insert-me \u0648"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('<'),
"insert-me \u0648"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('m'),
"insert-me \u0629"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('M'),
"insert-me \u0629"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('n'),
"insert-me \u0649"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('N'),
"insert-me \u0671"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('b'),
"insert-me \u0644\u0627"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('B'),
"insert-me \u0644\u0627"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('v'),
"insert-me \u0631"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('V'),
"insert-me \u0631"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('c'),
"insert-me \u0632"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('C'),
"insert-me \u0632"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('x'),
"insert-me \u0621"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('X'),
"insert-me \u0621"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('/'),
"insert-me \u0637"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('?'),
"insert-me \u0637"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('ç'),
"insert-me \u0643"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('Ç'),
"insert-me \u0643"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('l'),
"insert-me \u0645"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('L'),
"insert-me \u0645"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('k'),
"insert-me \u0646"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('K'),
"insert-me \u0646"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('j'),
"insert-me \u062A"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('J'),
"insert-me \u062A"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('h'),
"insert-me \u0627"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('H'),
"insert-me \u0654"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('g'),
"insert-me \u0644"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('G'),
"insert-me \u0644"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('f'),
"insert-me \u0628"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('F'),
"insert-me \u0628"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('d'),
"insert-me \u064A"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('D'),
"insert-me \u064A"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('s'),
"insert-me \u0633"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('S'),
"insert-me \u0633"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('a'),
"insert-me \u0634"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('A'),
"insert-me \u0634"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('['),
"insert-me \u062F"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('{'),
"insert-me \u062F"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('\''),
"insert-me \u062C"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('`'),
"insert-me \u062C"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('p'),
"insert-me \u062D"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('P'),
"insert-me \u062D"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('o'),
"insert-me \u062E"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('O'),
"insert-me \u062E"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('i'),
"insert-me \u0647"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('I'),
"insert-me \u0647"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('u'),
"insert-me \u0639"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('U'),
"insert-me \u0639"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('y'),
"insert-me \u063A"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('Y'),
"insert-me \u0655"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('t'),
"insert-me \u0641"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('T'),
"insert-me \u0641"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('r'),
"insert-me \u0642"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('R'),
"insert-me \u0642"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('e'),
"insert-me \u062B"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('E'),
"insert-me \u062B"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('w'),
"insert-me \u0635"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('W'),
"insert-me \u0635"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('q'),
"insert-me \u0636"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('Q'),
"insert-me \u0636"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('0'),
"insert-me \u0660"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('1'),
"insert-me \u0661"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('2'),
"insert-me \u0662"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('3'),
"insert-me \u0663"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('4'),
"insert-me \u0664"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('5'),
"insert-me \u0665"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('6'),
"insert-me \u0666"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('7'),
"insert-me \u0667"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('8'),
"insert-me \u0668"),
new JTextComponent.KeyBinding(KeyStroke.getKeyStroke('9'),
"insert-me \u0669")
};
static final Action[] arabicActions = {
new InsertMeAction("\u0638"),
new InsertMeAction("\u061F"),
new InsertMeAction("\u0630"),
new InsertMeAction("\u0630"),
new InsertMeAction("\u0648"),
new InsertMeAction("\u0629"),
new InsertMeAction("\u0649"),
new InsertMeAction("\u0671"),
new InsertMeAction("\u0644\u0627"),
new InsertMeAction("\u0644\u0627"),
new InsertMeAction("\u0631"),
new InsertMeAction("\u0631"),
new InsertMeAction("\u0632"),
new InsertMeAction("\u0632"),
new InsertMeAction("\u0621"),
new InsertMeAction("\u0621"),
new InsertMeAction("\u0637"),
new InsertMeAction("\u0637"),
new InsertMeAction("\u0643"),
new InsertMeAction("\u0643"),
new InsertMeAction("\u0645"),
new InsertMeAction("\u0645"),
new InsertMeAction("\u0646"),
new InsertMeAction("\u0646"),
new InsertMeAction("\u062A"),
new InsertMeAction("\u062A"),
new InsertMeAction("\u0627"),
new InsertMeAction("\u0654"),
new InsertMeAction("\u0644"),
new InsertMeAction("\u0644"),
new InsertMeAction("\u0628"),
new InsertMeAction("\u0628"),
new InsertMeAction("\u064A"),
new InsertMeAction("\u064A"),
new InsertMeAction("\u0633"),
new InsertMeAction("\u0633"),
new InsertMeAction("\u0634"),
new InsertMeAction("\u0634"),
new InsertMeAction("\u062F"),
new InsertMeAction("\u062F"),
new InsertMeAction("\u062C"),
new InsertMeAction("\u062C"),
new InsertMeAction("\u062D"),
new InsertMeAction("\u062D"),
new InsertMeAction("\u062E"),
new InsertMeAction("\u062E"),
new InsertMeAction("\u0647"),
new InsertMeAction("\u0647"),
new InsertMeAction("\u0639"),
new InsertMeAction("\u0639"),
new InsertMeAction("\u063A"),
new InsertMeAction("\u0655"),
new InsertMeAction("\u0641"),
new InsertMeAction("\u0641"),
new InsertMeAction("\u0642"),
new InsertMeAction("\u0642"),
new InsertMeAction("\u062B"),
new InsertMeAction("\u062B"),
new InsertMeAction("\u0635"),
new InsertMeAction("\u0635"),
new InsertMeAction("\u0636"),
new InsertMeAction("\u0636"),
new InsertMeAction("\u0660"),
new InsertMeAction("\u0661"),
new InsertMeAction("\u0662"),
new InsertMeAction("\u0663"),
new InsertMeAction("\u0664"),
new InsertMeAction("\u0665"),
new InsertMeAction("\u0666"),
new InsertMeAction("\u0667"),
new InsertMeAction("\u0668"),
new InsertMeAction("\u0669")
};
/** Exit the Application */
private void exitForm(java.awt.event.WindowEvent evt) {
System.exit(0);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
arabicTextArea novo = new arabicTextArea();
novo.setBounds(0,0,800,600);
novo.show();
}
// Variables declaration
private javax.swing.JPanel jPanel2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea jTextArea1;
// End of variables declaration
static class InsertMeAction extends TextAction {
public InsertMeAction( String s ) {
super("insert-me " + s);
this.s = s;
}
public void actionPerformed(ActionEvent e) {
JTextComponent target = getTextComponent(e);
if (target != null) {
target.replaceSelection(s);
}
}
private String s;
}
}يعني نريد تطويره بحاجة الى افكار وساقوم بعملها
فكرتي مثلا اضافة زر معين وعند الانتهاء من الكتابة نضغط save ومن ثم يقوم بالتخزين بالرموز ما هي افكاركم ?