[Swing Unicode Eclipse]

Hi all,
I'm doing a swing application in which I use Jtable.
In this Jtable, i want that the user can enter unicode character so
i do this :
Font font_unicode = new Font("Arial Unicode MS", Font.PLAIN, 13);
table.setFont(font_unicode);It works fine : the user can enter japanese character.
My problem is that when i want to save data that are in my jtable. I want to save it in a txt file(I use a txt filter), I loose unicode character.
I use a save dialog as you can see :
if (chooser.showSaveDialog(chooser) == JFileChooser.APPROVE_OPTION) {
               try {
                                   BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(chooser.getSelectedFile()), "8859_7"));
     PrintWriter fileWriter = new PrintWriter(bufferedWriter);
}I saw that in excel(office) there is a possibility to save in "unicode text" and I would like to know if it's also possible in swing. I really need it because i develop it for a company.
I'm waiting for your answer..
THX

Yes it works!!!!!!!!!
Thanks a lotSorry to sound petty, but can I have the duke dollars?

Similar Messages

  • Swings in Eclipse

    Hi All,
    Please tell me how can i work with Swings in Eclipse? What configuration needs to be done for this?
    Thanks & Regards,
    Sneha

    hi!
    its simple...
    1) create a java project
    2) add package [optional]
    3) add your own class and then right click on the .java file which one is having the main function.
    4) then click run as->java application.
    i guess this runs the application. you can use any swing component which is supported by your installed java.
    regards
    Aniruddha

  • Swing and eclipse

    Hello I am trying to build GUI in eclipse enviorment ,as I read I need to install Visual Editor but after downloading it I didn;t find a way to install it.
    How can I do it? Or maybe there is some other way to create GUI forms with eclipse?

    Or maybe there is some other way to
    create GUI forms with eclipse?Yeah, I just type in what I need directly into the file. It kind of depends on what you are trying to do. If you are relatively new at programming, I strongly recommend that you don't use a visual GUI editor, but rather that you type in what you need and how you want it used. It is truly the best way to learn the ins and outs of eclipse.

  • NetBeans or Eclipse: Which is better for GUI development ?

    I am relatively new with JAVA, came from embedded software domain mostly in C.
    My interest is to learn and develop the GUI applications using Swing.
    I am currently in a process of evaluating the IDEs, Eclipse and NetBeans on Linux desktop environment (SuSE 10.3).
    My primary findings found that, NetBeans is better equipped with GUI development while Eclipse needs to have a plugin installed.
    For GUI development, I found that few of my fellow Java developer friends have mixed feelings about these two wonderful IDEs, in summary here are the comments:
    1) Developing GUI is better without any assistance from built in designers of IDEs (e.g. NetBeans or Visual Swing of Eclipse). Because, they put extra 'garbage" codes which are very much IDE specific.
    2) GUI development in NetBeans is faster and more productive than Eclipse
    3) Visual Swing for Eclipse is not a matured product and it is far inferior than NetBeans' capabaility
    Now I ask a question, what is the best practice to adopt for starting the GUI development ? NetBeans or Eclispse or IDE-less development ?
    Thanks.

    atomodachi wrote:
    Now I ask a question, what is the best practice to adopt for starting the GUI development ?
    NetBeansThis is my preference for IDE's. Please note that as I stated that is my preference. There isn't any best, some are clearly better than others for one reason or another, but once again, that boils down to personal preference.
    EclispseNot my preference.
    IDE-less development ?IMO: that is just silly. Unless you just enjoy tons of typing; why would you ever embark on doing something without a tool to speed up the process. Now that is not to say that in using your IDE you should start out by just dragging and dropping up a storm and merrily running down the road in ignorance until you hit a rough spot and have things dramatically pointed out that you've really not a clue about what is happening. Use the IDE, but learn how to do the manual processes along with it. That means that sometimes you'll not drag and drop to build your GUI, you'll actually code the entire thing. And you really should learn to do things command-line like compile. Do yourself a really big favor too, learn the debugger. The integrated debuggers is, perhaps, one of the best inventions in productivity tools that has as of yet been invented for developers.
    In any case, have fun... choose what you like, it really does come down to personal preference. I've worked in several shops over the years and most have come to the conclusion that if you can get the work done, and have projects that others can use, then to each their own preferences. The discussion rages on for and against each of the systems that you have mention--each have valid arguments--it boils down to what do you want and like.

  • Netbeans Vs Eclipse .which one is best ?

    hello,
    My project work related to SNMP protocol. In my project I need to get and set data in a remote wireless device. for this , I want to know which one IDE (netbeans or eclipse) shall i use for my project.
    now I am working in netbeans. but, the problem is it may strucking up some times and it takes some time while getting data and also at that time it struck.
    If any one use the both IDEs, give your suggestions.
    thank you.

    I use netbeans at work, I am currently using the
    latest release. I find it quite slow, and it hangs
    quite often for periods of anything between 10
    seconds and 2 minutes.
    One of my colleagues is now using eclipse as he was
    having similar problems with netbeans, and I am
    thinking of changing to eclipse.
    I will wait until I get a ram upgrade for my work
    machine though, as this could be the reason I am
    experiencing this.I used to have this problem too whenever I unplugged my computer and it was running off of battery (I'm using a laptop). It frustrated me for a long time until someone suggested it was my power settings. I also noticed in the interim that it wasn't just NetBeans, it was all my Java programs. My graphics card (ATI Radeon) was optimizing for battery life when my computer wasn't plugged in. So I adjusted my power settings and now NetBeans works fine whether or not my computer's plugged in.
    I did briefly use Eclipse before I changed my power settings, and it didn't seem to suffer from the same problems NetBeans did. I think it's due to the fact that NetBeans uses Swing whereas Eclipse uses SWT.

  • How to import wsdl in jbuilder or myeclipse

    Hi,
    I'm trying to make the web service client work. I have been searching on the subject, but not been able to do so.. Please tell me how to import a WSDL link (which I have) in Jbuilder or MyEclipse.
    Thanks,
    Katie

    >>>Could you give me any pointer how to achieve the ED creation in NWDS?
    Import as external definition is planned for 7.5.
    Before you start working on NWDS may be have a look at the below blog ( Including comments )
    From Swing to Eclipse: My two months experience on NWDS 7.31

  • Java GUI does not work in Ubuntu

    Hello everybody,
    I made an GUI application using Swing and Eclipse. When I run it, the GUI shows up, and the program works until I place the pointer on top of the program's window. When I do so, the program freezes and after a couple of seconds I get a message telling me that the program is not responding.
    The code itself should not be the problem because I tried several well established Hello Worlds applications. Other users also report that this code works fine on theri computers.
    Probably it is important to notice that SWT based Hello World applications work fine on my Ubuntu (only Swing based applications freeze).
    It has been suggested that the problem can be in the default JDK used by Ubuntu. I tried to solve the problem in this direction. I typed "aptitude search jdk" in the command line and found out that "sun-java6-jdk" is the only JDK installed on my computer. So, it should be OK.
    Any ideas what can be wrong?
    The old dicussion about this subject was blocked (it is here: http://forums.sun.com/thread.jspa?threadID=5402905&tstart=0)

    // This code generate a text area.
    // Taken from http://www.javafaq.nu/java-article743.html
    import java.awt.*;
    import javax.swing.*;
    public class HelloWorldSwing extends JFrame {
             JTextArea m_resultArea = new JTextArea(6, 30);
             //====================================================== constructor
             public HelloWorldSwing() {
                 //... Set initial text, scrolling, and border.
                 m_resultArea.setText("Enter more text to see scrollbars");
                 JScrollPane scrollingArea = new JScrollPane(m_resultArea);
                 scrollingArea.setBorder(BorderFactory.createEmptyBorder(10,5,10,5));
                 // Get the content pane, set layout, add to center
                 Container content = this.getContentPane();
                 content.setLayout(new BorderLayout());
                content.add(scrollingArea, BorderLayout.CENTER);
                 this.pack();
             public static void createAndViewJFrame() {
                 JFrame win = new HelloWorldSwing();
                 win.setTitle("TextAreaDemo");
                 win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                 win.setVisible(true);
             //============================================================= main
             public static void main(String[] args) {
                  SwingUtilities.invokeLater(new Runnable(){
                       public void run(){
                            createAndViewJFrame();
    }

  • JDBC for Macintosh

    Hi guys
    I'm new to java and i own a Mac with Leopard OSX
    i'm developing small applications in swing with Eclipse IDE and no what i would like to use is the Java DB
    I know its already integrated in mac osx but i dont know how to access it.
    Does anyone have advices?

    classboy wrote:
    I know its already integrated in mac osx but i dont know how to access it.Are you sure about that? It doesn't come as part of Apple's JDK, so unless you installed it as part of some other installation (netbeans?) then it's not there by default.

  • Please recommend Java development package..?

    Hi all,
    I'm new here, and would like your recommendation on a development package. Currently I write all my Java in a UNIX editor, and "println" is my debugger. ;-)
    I want to "upgrade" to a nice graphical editor w/ drag-n-drop, lots of good online documentation and an excellent debugger. Probably will go w/ Windows, but maybe Linux. I'm not doing servlets or applets or anything like that - just applications w/ basic Swing, w/ vast amounts of file/socket I/O and data crunching.
    Would greatly appreciate your recommendations for a moderately-priced package, like maybe JBuilder Pro?
    Many thanks, -tm

    I have gown quite fond of the Eclipse IDE and it is supported on Linux, WIndows platforms. Oh, and its free. Choose the v2.0 Stable build (beta) from www.eclipse.org.
    Or, look into Forte for Java Community Edition (also free). It is quite good, but I have found it unusable on remote X terminals due to Swing whereas Eclipse still performs quite well on both local and remote X terms.
    Many folks I know on Unix and Windows platforms live life quite well with their favorite editor (xemacs, vi, TextPad, whatever) and JDB. Many live with no debugger and I too have had to get by that way as well. It works for me too.
    Chuck

  • Unicode characters are shown as "question marks" in Eclipse console

    I am trying to retrieve Unicode data from Sybase database using jdbc.
    The data are stored in Sybase with unichar and univarchar datatypes.
    Following is the java code tring to run.
    {color:#808080}public class Test
    public static void main(String [] args) throws Exception
    CoreServiceSoapBindingStub binding_Core = new CoreServiceSoapBindingStub();
    CoreWSServiceLocator locator_Core = new CoreWSServiceLocator();
    binding_Core = (CoreServiceSoapBindingStub) locator_Core.getCoreService();
    Contact[] con = binding_Core.getContact();
    for(int i=0;i< con.length;++i)
    System.out.println(con.getLastName());
    }{color}
    The result of this code in Eclipse console should be as follow (consists of one English and one Japanese name).
    {color:#808080}Suzuki
    &#37428;&#26408;{color}
    However when I run this, I get the following.
    {color:#808080}Suzuki
    {color}
    The alphabetical characters seem to diplay fine in the console, but foreign characters are not....
    The default character set of the database is ISO-8859-1, but I used unichar and univarchar to store data in unicode thus believe no issue at database side...
    Used jconnect 6.05 (com.sybase.jdbc3.jdbc.SybDriver
    ) for the database driver.
    Java files are encoded in UTF-8.
    Console Encoding is UTF-8.
    Is this an issue in database driver?
    Since I set the parameters for character set to UTF-8 in both the database and java files....
    It would be great if someone could give some comments on this issue....
    Thanks a lot.

    It might be better to ask this question on an Eclipse forum. I have a couple of suggestions, but none of them have made the output in my console look entirely correct:
    1. Try to start Eclipse with these parameters: -vmargs -Dfile.encoding=UTF-8
    2. Try switching the font settings for the Console under Preferences in Eclipse.

  • Plug a Swing-based development tool into Eclipse

    This article teaches you how to integrate a stand-alone Swing-based editor into the Eclipse Platform as a plug-in. Using simple techniques, you can share resources between the Swing tool, the Eclipse Platform, and various SWT widgets -- and these resources can communicate through mutual awareness. Tool vendors who want to bring Eclipse-based development tools to market with a minimal amount of re-coding will also find this article helpful.
    Learn how to integrate a Swing editor into the Eclipse Platform
    http://www-106.ibm.com/developerworks/java/library/os-swing/?t=gr,JavaW03=EclipseSwing

    Originally posted by: martin.brenda.martinbrenda.de
    > Anybody is welcomed to share any first-hand expreience, links, opinions,
    > plz!
    I am working since a few months on this topic. We have a Swing Application
    which we want to integrate in Eclipse. We decided to do this in little
    steps. One of the first is to integrate the application as far as possible
    over the Swing Bridge. And the results are really good. We integrated our
    editor, some views, resources and the most actions so far. We hope to
    release our Alpha version in February.
    The really nice thing is, that we could take allmost all our existing Swing
    Wizards and so on from the old application. Only some wizards for Project
    and new Resource creation had be made new. The communication between AWT /
    Swing and SWT is also runnig well. All events (Mouse, Keys..) are being
    transfered from one toolkit to the other. The only problem is the
    synchronization of the Swing and SWT thread. You often get "Invalid thread
    access" messages. But this is solvable.
    Gentleware also integrated their modelling tool Poseidon in Eclipse over the
    Swing-Bridge. If you wanna see how it looks like, here the download page:
    http://gentleware.com/downloadcenter.0.html
    You need the Professional version. Their integration is not so nice (I think
    they did it really fast). But I think they work on it in the future. But
    here you can see that it works ;-)
    Here are also some links:
    http://eclipsewiki.editme.com/CallingSwingFromSWT
    http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet135.java?rev=HEAD& amp;content-type=text/vnd.viewcvs-markup&only_with_tag=H EAD
    http://www.logemann.org/day/archives/000008.html
    Bye,
    Martin Brenda

  • Debug the swing application from eclipse

    Hi
    I had a swing application, to create a exe file i build the application using using build.xml. To run the application we need to open the exe file.
    I want to debug this swing application from eclipse. Can anybody please tell me how to debug this application.
    Note: I can able to debug simple swing application. But i can't able to debug this application.
    Thanks
    mindus

    If it's an actual .exe--that is, if you've compiled it to a native Windows executable--then you can't debug it using a Java debugger (such as the one in Eclipse).
    If, on the other hand, you just have a .jar file or a bunch of .class files, then you can debug this app the same way you debugged the other one.
    If you don't provide more details about what you actually did and what exact problems you're having ("I can't do it" contains no useful information whatsoever), then it's impossible to provide any more detailed advice than this.

  • Two SWING apps show different UNICODE bahaviour

    We have developed two SWING applications. In both of them we save information by writing to disk using UTF-8 format. When the files are read back and displayed using JTextField then one of the applications is able to display the (Bengali) characters properly but the other applications is displaying garbage.
    We are using Java (JRE) version 1.5.0_01. The Unicode font (Likhan.ttf) is kept under the directory "JRE/lib/font/fallback". The files written to disk are text (XML) files.
    Any idea what we might be doing differently in one application from the other?

    UNIX ?
    1. check user locale
    it should be xx_XX.UTF-8. xx_XX - doesn't matter, but UTF-8 is important.
    e.g.
    LANG="en_EN.UTF-8"
    LC_CTYPE="en_US.UTF-8"
    LC_ALL=
    2. try to compile you class with -encoding utf-8 option
    javac -encoding utf-8 Your.java
    3. try to output some text in Bengali to JTextField directly from code to understand where exactly the problem arise.
    4. check system property file.encoding
    class Enc {
         public static void main(String[] args) {
              System.out.println(System.getProperty("file.encoding"));
    }how do you read data from file? do you specify encoding directly?

  • Display Unicode Character in Swing Objects

    I am trying to display Chinese Characters using Swing GUI.
    I created Unicode strings using escape character \uXXXX
    I displayed \u4e00 successfully
    However when I tried to display \ub8db i got a square box displayed instead.
    I am using: Winnt ver 4 ,RichWin 97
    private Object listData[] = {
    new String("\ucfe3\ub8db"), // Two boxes displayed in list
    new String("\u4e01\u4e00"), // Characters displayed correctly
    new String("Third selection")
    To hope to get some replies ASAP. Thanks!!!
    Regards,
    Patrick

    Hi Patrick,
    Yeh, fonts are rather ubiquitous when it comes to internationalization. The fact that the font.properties files still exist confuses a lot of people. In reality, Sun doesn't support them any more, and they aren't all that useful if you're actually deploying your code onto other machines.
    So, to answer your questions... :D
    1) Each component will have a font set on it. To start with, each component will end up with the JDK default, usually the Dialog font in Java. From memory, I think this maps to Arial on Windows systems, though I'm not sure if RichWin alters this in anyway, as I haven't used it myself.
    You can check the available fonts on your machine by calling:
    GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
    This returns an array of strings. You can basically create a new font from any of the names that appear in here. For instance, if one of the strings was "Arial Bold", you could create the following font:
    Font myFont = new Font("Arial Bold", Font.PLAIN, 12);
    2) The best way is to simply create the font you want on startup. If you can't rely on the font
    you need being installed on every machine you plan to run your program on, the best solution is to either install it on startup, or carry it around with you.
    Have a look at Font.createFont(), as it allows you to create a new Font object from a *.TTF file (a TrueType font). In JDK1.3, this is buggy, leaving a large temp file behind every time you run it, but I've already tried this under Merlin Beta, and it's fixed and working fine.
    The reason this is handy is because the font we keep talking about on here, Arial Unicode MS, is a TrueType font. So you can carry the font around with you, and load it on startup using this call.
    Arial Unicode MS is a 23Mb font, but it's capable of displaying just about any character you could imagine.
    The trick from there, once you've loaded your font, is to make sure you call setFont() on just about any component you create. Menus are a cow - you've got to listen for events, as the dropdown menus don't always get the font straight away. But other than that, it's fairly simple.
    3) The short answer is to call the getAvailableFontFamilyNames() call above, and look for any familiar font names. If you can't find any, you know you're not going to be able to display anything.
    Windows seems to have standard fonts for the international languages. In Chinese, this is SimHei for Simplified (mainland) Chinese, and MingLiU for Traditional (Taiwanese) Chinese. Simplified covers about 30,000 Kanji, while Traditional covers around 80,000.
    So for Chinese, you would look for "SimHei" and "MingLiU", plus any of the fonts capable of displaying anything, like "Arial Unicode MS". If none of these strings are in the array, you may want to carry the Arial Unicode MS installer around with you and execute it. This file is about 11Mb, and is available as a download off the Microsoft website.
    4) Probably about the most useful thing I've come across is the Sun I18N tutorial on this very website. There isn't a heck of a lot out there, unfortunately. About the only other things I can recommend are http://www.unicode.org for the Unicode character codes, and http://www.njstar.com for NJStar Communicator, which you'll find useful if you're working with Chinese.
    Oh, and watch this forum, of course. ;D
    Hope that helps!
    Martin Hughes

  • Eclipse hangs and the JVM terminates in a Swing app incorporating JavaFX

    Hi everyone,
    I have a situation that is driving me nuts. I am developing a Swing based application which is incorporating some JavaFX components,mainly the TableView and a few layouts. I have wrapped all the javafx components into a common control for use application wide. I am also using an Eclipse plugin (Window Builder Pro) to layout the swing stuff.
    Now, my issue is, when I preview the JFrames and other components making use of the said simple custom control referred above, it only allows me to preview the JFrame once, there after Eclipse hangs and the JVM terminates.
    After some research, the most likely cause of this is that the reference to jfxrt.jar i have referenced in the project is loading some native dlls which can/should only be loaded once in the lifetime of a JVM. It looks like for some reason, my app is trying to load the native libs after it has already loaded them initially.
    The Application needs to be developed in Eclipse so netbeans is not an option.
    Am just getting started with maven, i don't have the know to build a project of this complexity with maven.
    Has any one encountered this issue and how did they walk around it?
    Any assistance would be greatly appreciated.

    After further digging around, the actual exception that causes the jvm to terminate is java.lang.UnsatisfiedLinkError due to an attempt to reload \JavaFX_2.0_SDK\rt\bin\mat.dll, anyone knows how to overcome this ?

Maybe you are looking for