Problem in Swing tree root node when displaying Japanese

I'm trying to create a tree using DefaultTreeModel. The root node will display text in Japanese and the other child nodes are in English. My problem is the root node fails to show Japanese correctly (only squares are shown).
I've already set my font.properties.ja to display Japanese font for virtual font "dialog":
dialog.plain.0=Arial,ANSI_CHARSET
dialog.plain.1=\uff2d\uff33 \u30b4\u30b7\u30c3\u30af,SHIFTJIS_CHARSET
dialog.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
dialog.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
And I've checked the "Tree.font" of UIManager is:
Tree.font = javax.swing.plaf.FontUIResource[family=dialog,name=Dialog,style=plain,size=12]
I'm quite sure that my font.properties.ja is correct as all message dialogs in my app. shows Japanese correctly (also using the same dialog font).
I got stuck. Can anyone please give me some advice? Thanks in advance.

hello!
first of all i am sorry that i cannot help u.
i am a java developer and start work on
Arabic ( one of the langugae supported by
unicode) text editing.If u have any knowledge that
what i should do to display the text in this language
in a textarea.when i run a code,this display only
square.
plz help me.i will be realy thankful to u.
Qaiser Mehmood
[email protected]

Similar Messages

  • Tree - selecting and expanding root node

    I want to have a tree root node expanded at start.
    I have tried:
    tree.selectedIndex = 0;
    if (tree.selectedItem && tree.dataDescriptor.isBranch(tree.selectedItem))
         tree.expandChildrenOf(tree.selectedItem, true);
    ...but it doesnt work.
    Anyone ...?

                    var node:XML = mainTree.root as XML;
                    mainTree.expandItem(node, true);
    You could also toggle it:
                    var node:XML = mainTree.root as XML;
                    var isOpen:Boolean = mainTree.isItemOpen(node);
                    mainTree.expandItem(node, !isOpen);

  • Tree with multiple root nodes does not display

    I am trying to create a tree to display some hierarchical data which contains several root nodes.
    I have specifed that the TREE_ROOT value is always Null as the root nodes have a null value for the PARENT_ID. The page displays yet none of the data is displayed.
    I have manage to get it to work by creating a dummy single root that I reference from the existing root values?

    Phattam,
    The TREE_ROOT identifies the root node's ID, not its PARENT_ID.
    For example, if we build a tree on the oehr_employees table, the ID is EMPLOYEE_ID and the PARENT_ID is MANAGER_ID. therefore, to identify the start of the tree, we could populate the TREE_ROOT with a select statement e.g.
    SELECT employee_id FROM oehr_employees WHERE employee_id = 100This identifies a single value and the tree starts from employee_id 100.
    If we used a select statement that retrieves more than one row, e.g.
    SELECT employee_id FROM oehr_employees WHERE manager_id = 100then the tree starts at one of the children of employee_id 100 - ApEx will not show a tree that has more than one starting node. If you want to show these alternative starting points, you'll need to do exactly what you have done - create a 'dummy' root node.
    Hope this helps,
    Bryan.

  • Problem in building swing tree

    I am trying to build a tree with the values obtained from the database.
    I have clearly explained the steps i have followed and the problem i am facing
    Please look at the below code, where i have given step by step explanation
    can any one help me i n solving my problem?
    //global variables
    String ioGlobalDesc = null;
    TransferObject transObj = null;
    ObjVO[] ioObjVO = null; //holds the values to build the intial tree
    ObjVO[] ioObjExpTree;//hold the child value of the every expansion
    pv.jfcx.PVNode root;
    1) I have a root node PVNode which inturn extends DefaultMutableTreeNode
    pv.jfcx.PVNode root;
    2) createIntialTree()
    This is the first method i call to obtain the values from the database .This method inturns
    call the setRootNode method to build my initial tree where i am passing the root and the ioObjVO[] which has the
    values obtained from the database
    /******************createInitial Tree starts here****************************/
    public void createIntialTree(TransferObject poTransferObject)
              Hashtable output = poTransferObject.getResponseData();
              ioObjVO = (ObjVO[]) output.get("ObjVO");
              setRootNodes(root,ioObjVO);
    3) After the setRootNode method is called from the createIntial tree,I am setting the values obtained
    from the database to the root node.Here i am using my own class called MyNode which extends the PVNode,
    This i am creating to set the desc and id for the particular node.
    If you see the setRootNode method, I have created a node called ioCategory where i am setting the id and
    description for the particular node. i have added ioCategory Node to the HashMap where desc is set as key and ioCategory itself is the value.
    Now ioCategory node is added to the root node.
    I am finiding the childcount for the obtained values from the database.while building the intial tree itself,if the child count is greater than zero,i am creating a subNode with empty values, this i am creating to denote that the particular node has the child.
    i am adding the subNode to the ioCategory.
    Now i am able to see the intial tree and also if node has childcount>0 then i am able to see the node handle.
    Now if i click any of the node which has the childcount>0,it has take the particular node id and fetch the relavant child values
    for the id i send,This is done when i expand my tree
    Now i have expanded a node Which has childcount>0 and retrieved the values from the database
    please see the treeExpand method,where the Expansion event is triggered and every expansion i am sending the
    id to the database.
    Here i have a global vairable called [ioGlobalDesc = e.getPath().getLastPathComponent().toString();]
    where i am holding the current event triggered.
    In the expandTree method , this is the method which is being called for every expansion i make ,
    Here i will be gettig the values for the node expansion.Now i am setting this value to the
    subnode where i am tryting identity the same parent to fix all the child to the same.
    for this i have stored my current expansion path and made that as node so that i can fix my childvalues to
    this.temp node should actually denote my ioCategory node for which i need to fix the child values.
    MyNode temp =(MyNode) loHashMap.get(ioGlobalDesc);
    I have another method called createnode to set my child values to the parentnode.Here i am passing the temp as the parameter
    which holds the current parent for which i have to fix the values that i have already obtained in the
    expandTree method.ioObjExpTree[] holds the childvalues for every expansion i make
    My problem is, i am unable to find the same parent for which expansion is made and unable to fix the child nodes.Is there any way to do this?
    How do i create both the parent and the child as a dynamic node?
    ie is the way i proceeded is right or wrong???????????? i am totally confused.
    can any one please help me in solving my problem??????????????
    Tell me where i have misunderstood???????????????.or my approach itself is wrong in creating the dynamic tree??
    if so how should i do it??????????????????????????????
    /****************************setRootNodes start*******************************/
    private void setRootNodes(pv.jfcx.PVNode root,ObjVO[] poObjVO) {
    int loCount=1;
    for (int i = 0; i < poObjVO.length; i++)
    if (poObjVO.getInHierarchyLevel() > 0)
    MyNode ioCategory = new MyNode(poObjVO[i].getIsHierarchyDesc(), poObjVO[i]. getIsObjID());
    loHashMap.put(poObjVO[i].getIsHierarchyDesc(),ioCategory);
    root.add(ioCategory);
    if (ioObjVO[i].inChildrenCount > 0)
    MyNode subNode = new MyNode("","");
    ioCategory.add(subNode);
    loCount++;
    /****************************treeExpanded*************************************/
    public void treeExpanded(TreeExpansionEvent e) {
    AssMO loAssMO = new AssMO();
    for (int i = 0; i < ioObjVO.length; i++)
    if (ioObjVO[i].inChildrenCount > 0 && ioObjVO[i].getIsHierarchyDesc().equals(e.getPath().getLastPathComponent().toString()))
    ioFirstHit++;
    ioGlobalDesc = e.getPath().getLastPathComponent().toString();
    e.getPath().getLastPathComponent().toString();
              loAssMO.setPID(ioObjVO[i].getPID());
         break;
    if(ioGlobalDesc!=null)
    // code goes here for sending the Id to the database which in turn calls my expandTree method which retrieves the
    /************************************expandTree Ends here**********************/
    public void expandTree(TransferObject poTransferObject) {
         Hashtable output = poTransferObject.getResponseData();
    ioObjVOExpTree = null;
         ioObjVOExpTree = (ObjVO[]) output.get("ExpandTree");
    MyNode temp =(MyNode) loHashMap.get(ioGlobalDesc);
    ioUCSLogger.debug("<--END OF EXPAND tree method-->");
    createNodes(temp);
    /************************************expandTree Ends here**********************/
    /****************************createNodes start*************************************/
    private void createNodes(MyNode poParent) {
    for(int x=0; x<ioObjVOExpTree.length; x++)
    MyNode iosubNode = new MyNode(ioObjVOExpTree[x].getIsHierarchyDesc(),ioObjVOExpTree[x].getIsObjID());
    loHashMap.put(ioObjVOExpTree[x].getIsHierarchyDesc(),iosubNode);
    poParent.add(iosubNode);
    iosubNode.setButton(1,false);

    Hi,
    I have used Tree Node type to get the nodes.
    The model that I use has the following structure:
    There is a top node called <b>Ot_Publ_Details</b>. It has 3 child nodes <b>RepObjects, Subagenobjects and Subscrobjects</b>. These child objects internally has two attributes each.
    The tree that i have created has Four Treenode types and 3 TreeItem types.
    I have bound the data source of the tree node to Ot_Publ_Details. The first TreeNode is also bound to Ot_Publ_Details. The second tree node is bound to the RepObejcts, the third node to the Subagenobjects and the fourth node to Subscrobjects. The 3 treeitem types are mapped to the corresponding child attributes.
    when i execute this application, I get a tree with the topnode taking the value from the first treenode while the other 3 nodes doesnt come as node. instead they come as leaf attributes and they display the values present in the attributes.
    Hope the model structure and the UI structure is clear.
    Regards,
    Chander

  • Netscape using plugin doesn't display Japanese characters in a tree node

    Hi,
    I have a problem displaying a swing tree node name in Japanese. The problem only occurs on Netscape browsers. When I run the same applet with Internet Explorer, all the Japanese displays correctly. Now, with Netscape, the node name is displayed in little rectangle characters but the tooltip is displayed in Japanese. I don't believe I have any problem with the Java code because it works with IE.
    I am using the java 1.3.1_01 plugin on a Windows NT machine that has a Japanese OS. I've also installed Japanese versions of Netscape. Also, Netscape is able to display my help files in Japanese correctly, so I am wondering if the problem is with the java plugin.
    Any clues?
    Many thanks

    Found the problem. I set a font type of Arial. It's best to set the type to MS Gothic, or dont' set it at all so the system default font is used.

  • JavaMapping in PI 7.1 Error:Unable to display tree view; Error when parsing

    hi,
    i get by testing in PI 7.1 (operation mapping) this ERROR:
    "Unable to display tree view; Error when parsing an XML document (Content is not allowed in prolog.)"
    this is my java-programm-code:
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import com.sap.aii.mapping.api.StreamTransformation;
    import java.io.*;
    import java.util.Map;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    /*IMPORT statement imports the specified classes and its methods into the program */
    /Every Java mapping program must implement the interface StreamTransformation and its methods execute() and setParameter() and extend the class DefaultHandler./
    public class Mapping extends DefaultHandler implements StreamTransformation {
    Below is the declaration for all the variables we are going to use in the
    subsequent methods.
         private Map map;
         private OutputStream out;
         private boolean input1 = false;
         private boolean input2 = false;
         private int number1;
         private int number2;
         private int addvalue;
         private int mulvalue;
         private int subvalue;
         String lineEnd = System.getProperty("line.separator");
    setParamater() method is used to store the mapping object in the variable
    "map"
         public void setParameter(Map param) {
              map = param;
         public void execute(InputStream in, OutputStream out)
                   throws com.sap.aii.mapping.api.StreamTransformationException {
              DefaultHandler handler = this;
              SAXParserFactory factory = SAXParserFactory.newInstance();
              try {
                   SAXParser saxParser = factory.newSAXParser();
                   this.out = out;
                   saxParser.parse(in, handler);
              } catch (Throwable t) {
                   t.printStackTrace();
    As seen above execute() method has two parameters "in" of type
    InputStream and "out" of type OutputStream. First we get a new instance
    of SAXParserFactory and from this one we create a new Instance of
    SAXParser. To the Parse Method of SaxParser, we pass two parameters,
    inputstream "in" and the class variable "handler".
    Method "write" is a user defined method, which is used to write the
    string "s" to the outpurstream "out".
         private void write(String s) throws SAXException {
              try {
                   out.write(s.getBytes());
                   out.flush();
              } catch (IOException e) {
                   throw new SAXException("I/O error", e);
         public void startDocument() throws SAXException {
              write("");
              write(lineEnd);
              write("");
              write(lineEnd);
         public void endDocument() throws SAXException {
              write("");
              try {
                   out.flush();
              } catch (IOException e) {
                   throw new SAXException("I/O error", e);
         public void startElement(String namespaceURI, String sName, String qName,
                   Attributes attrs) throws SAXException {
              String eName = sName;
              if ("".equals(eName))
                   eName = qName;
              if (eName.equals("NUMBER1"))
                   input1 = true;
              if (eName.equals("NUMBER2"))
                   input2 = true;
         public void endElement(String namespaceURI, String sName, String qName)
                   throws SAXException {
              String eName = sName;
              if ("".equals(eName))
                   eName = qName;
              if (eName.equals("NUMBER1"))
                   input1 = false;
              if (eName.equals("NUMBER2"))
                   input2 = false;
         public void characters(char[] chars, int startIndex, int endIndex)
                   throws SAXException {
              String dataString = new String(chars, startIndex, endIndex).trim();
              if (input1) {
                   try {
                        number1 = Integer.parseInt(dataString);
                   } catch (NumberFormatException nfe) {
              if (input2) {
                   number2 = Integer.parseInt(dataString);
              if (input2 == true) {
                   addvalue = number1 + number2;
                   mulvalue = number1 * number2;
                   subvalue = number1 - number2;
                   write("" + addvalue + "");
                   write(lineEnd);
                   write("" + mulvalue + "");
                   write(lineEnd);
                   write("" + subvalue + "");
                   write(lineEnd);
    in developer studio 7.1 i dont get error.
    this happens by testing the mapping-programm in ESR.
    can somebody help me please?

    Make sure that the xml created out after the java mapping is a valid xml with only one root node.
    Regards,
    Prateek

  • Highlight an ADF tree node when it is clicked

    Hello every onei ,
    Does anybody has any idea how to highlight an ADF tree node when it is clicked ?
    Here is my scenario:-
    I have a popup which has a tree component on left and when we click on any node in the tree we have to display the corresponding page on right side.
    As the tree is common for all pages in the popup, i created an XHTML template with tree. All the treenode pages will use this template to display the tree.This template i am using to implement in rest of the pages.
    So when i click any link on this tree will load the corresponding JSP. But i am loosing focus. i mean selected node is not highlighting. Because we are loading the entire target page with template.
    Could any let me know how to highlight the tree node ?
    The Main problem is we are not using ADF controllers. We are using managed beans, these managed beans attached to the JSPX pages.
    Kindly guide me if any one knows solution.
    Thanks & Regards,
    Sai Sravan.P

    Hello Sai,
    I am afraid you have posted your question in the wrong forum. This forum is about Oracle On Track Communication, a next-generation social enterprise collaboration product.
    Please re-post your question in an ADF related forum and I am sure someone will be able to answer.
    Thank you,
    Ernst.

  • How do i get to display the nodes under the root node in a JTree?

    In my JTree there is a root node.This root node has 4 child nodes.Each child node in turn has nodes under it.What i need to do is just display the child nodes under the root node i.e., the four child nodes and keep these child nodes in a collapsed state.How do i go sbout this?

    Please try this:
    tree.expandRow(0);
    SwingUtilities.invokeLater(new Runnable(){
        public void run(){
            tree.setRootVisible(false);
    });If you want to show the RootHandles:
    tree.setShowsRootHandles(true);If you want to keep nodes in collapsed state (not expandable):
            tel = new TreeWillExpandListener() {
                public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {
                    throw new ExpandVetoException( event, "Don't want" );
                public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException {
            tree.addTreeWillExpandListener(tel);Some reading material:
    http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
    http://java.sun.com/docs/books/tutorial/uiswing/events/treewillexpandlistener.html
    Edited by: Andre_Uhres on Nov 14, 2007 5:17 PM
    Edited by: Andre_Uhres on Nov 14, 2007 5:33 PM
    Edited by: Andre_Uhres on Nov 14, 2007 5:39 PM

  • How to get the root node of a tree?

    I wanna get all the leaf node of a tree.But JTree have no method about how to get the root TreeNode of a tree.Then how should I do?

    try this:
    http://javaalmanac.com/egs/javax.swing.tree/GetNodes.html?l=rel

  • ADF 10.1.3.0.4: tree leaf with no child nodes still displays folder icon?

    I was reading through Frank Nimphius's Blog and found the entry entitled "ADF Faces: Building a hierarchical tree from recursive tables - October 05, 2006" and found a tree example in which a tree leaf with no child nodes do not display the folder icon.
    I've followed the instructions listed with adf:tree, CoreTree and ChildPropertyTreeModel, but my tree leaves with no child nodes still displays the folder icon.
    How do I remove this icon when the node is a leaf with no children?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I figured it out.
    I used the ChildPropertyTreeModel.isContainer() method.
    --Todd                                                                                                                                                                                           

  • How to create multiple root node in a tree

    Hi Experts,
    As per my requirement I have two requirements for  tree creation:
    1) Create a Tree which can display multiple root node.
    2) Cretae a Tree which can display data directy without any folder.
    I am new in Tree development.
    Can any body help me out to get it done.
    If it is not possible then also i need a confirmation from experts.
    Regards,
    Madhu

    use method add_node of the class Cl_gui_alv_tree to add a node to the tree.
    In case of root node the parameter lv_relat_key is passed as blank.In order to create further child nodes pass the node key of the parent as the relat key of the child and use the method again.
    Regards,
    Abhi

  • Populate a canvas when a tree-leaf node is clicked

    I'm trying to populate a canvas or a list container with
    images when a tree-leaf node is clicked. I got the tree control
    working alright so far (populated via an external XML) but I'm
    having a hard time figuring out how to populate the adjacent
    container when a leaf node from a tree is clicked by a user. I know
    I'm supposed to code this in the 'change' event but am having a
    difficult time trying to figure out how to do this. I looked at the
    source code in some of the sample apps but I couldn't find anything
    that resemble what I'm trying to do.
    Since each leaf node would be unique, each one of them would
    trigger an external load of images (via http service) ... and so
    the url would be unique as well for each.
    'Appreciate the help from anyone who could help.
    Thanks.

    Thanks for the quick response Tracy ...
    Actually, I don't have mage load part coded yet :) ... I do
    have a somewhat general idea on how it should be coded though (i
    think, hehe). I'm thinking the selected item in the leaf node would
    have the data for the 'url' or 'folder location' of the images that
    would have to be retrieved and displayed in the canvas. I'm just
    not sure how to go about diplaying them in the canvas. Do I have to
    load them in some sort of array first and then datasourced it for
    my canvas? Not really sure how to go about doing it ... 'am totally
    newbie with Flex and just learning it by going through the online
    help and looking at the codes on some of the sample apps.
    Thanks again.
    pixelflip

  • Authorization problem when displaying icons in BW Report

    Hi All
    I have the following problem when display BW Report as iView: The report data itself is displayed perfectly but to display the icons (like DrillDown arrows, Hierarhy level open arrows) the Windows login message "Connect to <my BW server.com>:8000" appears and I have to enter BW user name and password explicitly. The system for BW is defined, the user is mapped, UIDPW method is used. Again, the report data itself is displayed, the problem is only with icons. I can see that the path to icons is like:
    http://<my BW server>.com:8000/sap/bw/Mime/BEx/Icons/s_b_up.gif
    How could I rid of this authorization request?

    Thanks! I already did this and it helped for most of icons. But for five remaining icons i still get authorization request althoug these icons are in the same path. The icons are:
    http://<server>.com/sap/bw/Mime/BEx/Icons/cascading.gif
    http://<server>.com/sap/bw/Mime/BEx/Icons/checked.gif
    http://<server>.com/sap/bw/Mime/BEx/Icons/separator.gif
    http://<server>.com/sap/bw/Mime/BEx/Icons/marked_right_35.gif
    http://<server>.com/sap/bw/Mime/BEx/Icons/loading.gif

  • Unable to display tree view; Error when parsing an XML document (Premature end of file.)

    Hi folks,
    I am using a cascaded mapping in my OM. I have a graphical mapping followed by the Java mapping. It is a flat file to IDOC mapping. Everything works fine in Dev but when I transport the same objects to QA, the Operation mapping though it doesn't fail in ESR testing tool, gives the following message and there is no output generated for the same payload which is successfully tested in DEV. Please advise on what could be the possible reasons.
    Unable to display tree view; Error when parsing an XML document (Premature end of file.)

    kalyan,
    There seems to be an invalid xml payload which causes this error in ESR not generating the tree view. Please find the similar error screenshot and rectify the payload.
    Mutti

  • Hello My ipads Power button is not working properly when I press it once it shows option to turn off instead of locking and some other display problems like it suddenly lockes down or display disappears ...Please help. Thank You

    Hello My ipads Power button is not working properly when I press it once it shows option to turn off instead of locking and some other display problems like it suddenly lockes down or display disappears ...Please help. Thank You

    Thanks for that information!
    I'm sure I will be calling AppleCare, but the problem is, they charge for the phone calls don't they? Because I don't have money to be spending to be on the phone with a support service.
    In other things, it seemed like the only time my MacBook was working was when I had Snow Leopard without the 10.6.8 update download that was supposed to be done to prepare for OS X Lion.
    When I look at the information of my HD it says that I have 10.6.8 but that was the install that it claimed to have failed and caused me to restart resulting in all of the repeated problems.
    Also, because my computer is currently down, and I've lost all files how would that effect the use of my iPhone? Because if it doesn't get fixed by the time OS 5 is released, how would I be able to upgrade?!

Maybe you are looking for

  • Mandatory update not working on Mountain Lion...

    Is anyone else having problems installing the Folio Builder Panel update on Mountain Lion? I tried downloading the update from two different browsers and I'm getting the following error message every time: Any suggestions?

  • I'm trying to update my iphone 3gs with itunes but just getting windows error message

    I am trying to update itunes to 5.0.1 version but get an error message at end saying There is a problem with this Windows installer package, a problem required for this install to complete could not be run. I am clueless as to what i have to do!

  • How can i read the number of lines written - in spreadshee​t array?

    hello NI,                        I am writing file as spreadsheet format continuously, contains date, time, chanel1, channel 2, channel 3..... etc. i just want to know how many lines has been written after file write.... Regards, Balaji DP

  • Jsp mysql insert image to database

    hi all my qry is this i have a register page and wish to give the user the option to upload there picture but i dont know quite how this is done i can insert all the rest of the data to my database am just unsure on the inserting of the image file ca

  • How would one convert Word files containing audio to a PC?

    I'm not sure if it's possible, but how could I convert Word files that contain audio from a Mac laptop to a PC laptop? I really would appreciate any help, as I truly need these files for academic reasons. Thank you