Arabic « Internationalization « Java Swing Q&A





1. Mix of Arabic and English causes problems in JTextArea (Java)    stackoverflow.com

I have a JTextArea which displays HTML of an Arabic web page. So it's essentially a mix of English and Arabic. In the JTextArea, with columns set to 30, certain text ...

2. Problem getting Arabic Text from JTextArea in Windows Application    stackoverflow.com

I am using JTextArea to show some mix of arabic and english text. I am able to show the the text with out any issues but when i try to get ...

3. String width via fontmetrics calculation is very slow if there are arabic or persian letters in text    stackoverflow.com

I have a problem. My application interface works much slower if i use eastern languages there. Especially i felt it in components such as JList, JCombobox, JTable. How i found the ...

4. Align text to the right in JOptionPane    stackoverflow.com

Is it possible to align the text to the right in JOptionPane? (I don't want to use JDialog) because I want to write some sentences in Arabic

5. set JFrame Orientation from right to left!    stackoverflow.com

To align my JFrame from righ-to-left, I use:

setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
but this works only if I use the following style (decoration) of the JFrame:
public class RightToLeft {
  public static void main(String []args){
  ...

6. Typing Arabic numbers in JTextField    stackoverflow.com

I am trying to type Arabic numbers in a JTextField and I used DocumentListener as follows:

txtName.getDocument().addDocumentListener(this);

...

public void insertUpdate(DocumentEvent e){setLabel();}
public void removeUpdate(DocumentEvent e){setLabel();}
public void changedUpdate(DocumentEvent e){}

public void setLabel()
{
    String ...

7. How to set the orientation of JTextArea from right to left (inside JOptionPane)    stackoverflow.com

I have JScrollPane with JTextArea inside it and I am trying to set the JTextArea's orientation from right to left so the text inside it will start from the right and ...

8. Creating custom JFileChooser    stackoverflow.com

To create an Arabic JFileChooser (RTL) I use the following: MyFileChooser:

import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.filechooser.FileView;
import java.io.File;
import java.awt.ComponentOrientation;
import java.awt.Dimension;
public class MyFileChooser extends JFileChooser
{
    private String extension;
    ...

9. Drawing text with outline in java    stackoverflow.com

I'm working with graphcis2d in Java and am currently using this to draw text into a bufferedImage

Font font1 = new Font("Arial", Font.PLAIN, 120);
g2d.setFont(font1);
FontMetrics fm1 = g2d.getFontMetrics(font1);     
g2d.drawString(s[1], ...





10. Arabic numerals in swing.JTextField java    stackoverflow.com

Peace be upon you all. javas.swing.JTextField does not support numerals of other languages like arabic, hebrew, chinese on input. I have researched a lot on this but I couldnt find a solution. ...

11. arabic text    coderanch.com

12. Arabic Problem    coderanch.com

Hi all-- I have a Servlet that write arabic characters. And I want to fill a JTable (myTable) by these arabic chars. I reade the servlet as follow: URL url = new URL(ServletURL); URLConnection con = url.openConnection(); //con.setRequestProperty("Content-Type","text/plain; charset = WINDOWS-1256" ); InputStream in = con.getInputStream(); InputStreamReader reader = new InputStreamReader(in,"WINDOWS-1256"); and i use an array of String to to fill ...

13. How to write Arabic text    coderanch.com

Hi everyone, I'm trying to build an application that mostly contains arabic(unicode) text from right to left for both as displayed and for the user of the application to enter text .... i'm using j2sdk 1.4.2 and JCreator to write my code .. So could anyone plz help me finding a way to do that ?? Gr8 Thx Ola

14. Arabic numbers input problem(Very Urgent)    coderanch.com

hi, I am facing a problem while entering Arabic numbers in the swing application. I have enabled arabic language input on my machine. I am in position to type arabic numbers in a notepad. But when I try and do the same in Swing application inside a textfield, somehow the numbers are getting typed in English only. Surprisingly if I type ...

15. Accepting the arabic character from keyboard in swing application !!    coderanch.com

Hello, I was trying to make a swing application which should do following:- 1. I want to provide a JTextField where a user can input the arabic character through his keyboard. 2. I should accept these arabic string in a variable and should convert these character into the unicode values. 3. after converting into the unicode values I want to store ...

16. JTextField and Arabic    coderanch.com





17. arabic RTF viewer problem    coderanch.com

hello dear friends... i do have done this code to view RTF file: import java.awt.*; import java.io.*; import javax.swing.*; import javax.swing.text.*; import javax.swing.text.rtf.*; class RTFViewextends JFrame { public RTFView() { setTitle( "RTF Text Application" ); setSize( 400, 240 ); setBackground( Color.gray ); getContentPane().setLayout( new BorderLayout() ); JPanel topPanel = new JPanel(); topPanel.setLayout( new BorderLayout() ); getContentPane().add( topPanel, BorderLayout.CENTER ); // Create ...

18. How to show arabic and arabic in a JTextBox when user enter the numbers?    coderanch.com

DocumentFilter filter = new DocumentFilter() { public void insertString(DocumentFilter.FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException { // modify string super.insertString(fb, offset, string, attr); } public void replace(DocumentFilter.FilterBypass fb, int offset, int length, String text, AttributeSet attrs) throws BadLocationException { // modify string super.replace(fb, offset, length, string, attrs); } }; AbstractDocument doc = (AbstractDocument)textField.getDocument(); doc.setDocumentFilter(filter);

19. How to convert arabic numbers received from JTextField to a Double?    coderanch.com

Hi Thank you for reaidng my post. I have a Swing application which users enter some infomation in its boxes. some of the information are arabic numbers like . which is an arabic double number. I am able to convert a long number simply using Long.parsLong(number) but when I use Double.parsDouble(num) I get the following error: Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: ...

20. Jtable problem with arabic    coderanch.com

21. Java AWT Right to left (arabic) support    coderanch.com

22. JTextField and Farsi or Arabic fonts.    forums.oracle.com

I don't know where is the problem, when you are typing or when you whant to display and retrive it from file or db. Anyway, as I know for multilanguage application you should use fonts that supports all language scripts that is applied in the app. One way to find out what scripts is supported by fonts is goto Format in ...

23. Unable to type Arabic in JTextField    forums.oracle.com

Quick google search returned this. Whatever the case might be, you have to start your VM using that encoding. 1. Add i18n.jar (comes with jre) to the class path. 2. If you have arabic data in .java file, compile using javac option -encoding Cp420 3. Start java using -Dfile.encoding=Cp420 option. Give it a try