Setting Dialog, Tree Node and Menu Font in JDeveloper 11.1.1.4/11.1.1.5

Hi,
I'm near sighted and thus dependent on being able to choose larger fonts. For the code editor, this poses no problem. For the widgets in the views surrounding the editor (containing tree nodes) and dialogs (with the Preferences dialog being one example), the font is very small at high screen resolutions (I don't want to resort to a lower resolution since I would like the fonts to appear as detailed as possible).
Is there any way to override the menu, tree node, and dialog font via command line switches and/or property/config files during JDeveloper startup in a platform independent way?
If it can't be done platform independently, what are the necessary steps on Linux (probably for the GTK lib) and Windows?
Thanks in advance!
Kind regards,
Holger

I previously developed under full screen option and my PC resolution was 1600x1200. But when the application was ran on other screens it was displaying with some page contents being cut out. It was due to other machines running on lower resoultion. I will need now redesign the pages to run on user defined lower resolution of 1280x1024. How do I setup Jdeveloper design tab to show for 1280x1024.
Thanks
Edited by: user5108636 on Feb 14, 2011 5:23 PM

Similar Messages

  • Tree Node and Ampersand

    Hi,
    I need to place ampersands in tree node text property. To get the text
    rendered right I need to provide the text as, for example, Bed '&+amp+;'
    Breakfast.
    This tree node is rendering well in the browser as "Bed & Breakfast".
    But if an action is associated with the tree node and I run the app
    the tree node is rendering to "Bed '&+amp+;' Breakfast".
    "&+amp+;" means the well formed XHTML for ampersand, if I had written this as it should be it would render in this post as &.
    Is there any workaround?
    Thanks.
    Stephan

    The Tree Node is now rendering right, but I run into another problem. After selection I need to display the Tree Node text in a static text component. which worked with this code:
    public String node_action() {
            String fullId = tree1.getCookieSelectedTreeNode();
            String id = fullId.substring(fullId.lastIndexOf(":")+1);
            TreeNode selectedNode = (TreeNode) this.getForm1().findComponentById(id);
            String category = selectedNode.getParentTreeNode((TreeNode) selectedNode).getText();
            if ( category.indexOf("&") != -1 ) {
                getSessionBean1().getClassified().setCategory(category.replace("&", "&"));
            else {
                getSessionBean1().getClassified().setCategory(category);
            String subCategory = selectedNode.getText();
            if ( subCategory.indexOf("&") != -1 ) {
               getSessionBean1().getClassified().setSubCategory(subCategory.replace("&", "&"));
            else {
               getSessionBean1().getClassified().setSubCategory(subCategory);
            categoryTextfield.setText(getSessionBean1().getClassified().getSubCategory());
            categoryTextfield.setVisible(true);
            return null;
    }(some & in the code section are original meant to be the XHTML for ampersand.)
    but for the few Tree Nodes which are prerendered now, the call
    String subCategory = selectedNode.getText(); returns null.
    How can I get the text of for those prerendered Tree Node?
    Thanks.
    Stephan

  • Help with building a JTree using tree node and node renderers

    Hi,
    I am having a few problems with JTree's. basically I want to build JTree from a web spider. The webspide searches a website checking links and stores the current url that is being processed as a string in the variable msg. I wan to use this variable to build a JTree in a new class and then add it to my GUI. I have created a tree node class and a renderer node class, these classes are built fine. can someone point me in the direction for actually using these to build my tree in a seperate class and then displaying it in a GUI class?
    *nodeRenderer.java
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.*;
    import java.net.*;
    public class nodeRenderer extends DefaultTreeCellRenderer
                                       implements TreeCellRenderer
    public static Icon icon= null;
    public nodeRenderer() {
    icon = new ImageIcon(getClass().getResource("icon.gif"));
    public Component getTreeCellRendererComponent(
    JTree tree,
    Object value,
    boolean sel,
    boolean expanded,
    boolean leaf,
    int row,
    boolean hasFocus) {
    super.getTreeCellRendererComponent(
    tree, value, sel,
    expanded, leaf, row,
    hasFocus);
    treeNode node = (treeNode)(((DefaultMutableTreeNode)value).getUserObject());
    if(icon != null) // set a custom icon
    setOpenIcon(icon);
    setClosedIcon(icon);
    setLeafIcon(icon);
         return this;
    *treeNode.java
    *this is the class to represent a node
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.util.*;
    import java.net.*;
    * Class used to hold information about a web site that has
    * been searched by the spider class
    public class treeNode
    *Url from the WebSpiderController Class
    *that is currently being processed
    public String msg;
    treeNode(String urlText)
         msg = urlText;
    String getUrlText()
         return msg;
    //gui.java
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class gui extends JFrame implements Runnable
         *declare variable, boolean
         *thread, a object and a center
         *pane
         protected URL urlInput;
         protected Thread bgThread;
         protected boolean run = false;
         protected WebSpider webSpider;
         public gui()
              *create the gui here
              setTitle("Testing Tool");
         setSize(600,600);
         //add Buttons to the tool bar
         start.setText("Start");
         start.setActionCommand("Start");
         toolBar.add(start);
         ButtonListener startListener = new ButtonListener();
              start.addActionListener(startListener);
              cancel.setText("Cancel");
         cancel.setActionCommand("Cancel");
         toolBar.add(cancel);
         ButtonListener cancelListener = new ButtonListener();
              cancel.addActionListener(cancelListener);
              close.setText("Close");
         close.setActionCommand("Close");
         toolBar.add(close);
         ButtonListener closeListener = new ButtonListener();
              close.addActionListener(closeListener);
              //creat a simple form
              urlLabel.setText("Enter URL:");
              urlLabel.setBounds(100,36,288,24);
              formTab.add(urlLabel);
              url.setBounds(170,36,288,24);
              formTab.add(url);
              current.setText("Currently Processing: ");
              current.setBounds(100,80,288,24);
              formTab.add(current);
         //add scroll bars to the error messages screen and website structure
         errorPane.setAutoscrolls(true);
         errorPane.setHorizontalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
         errorPane.setVerticalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
         errorPane.setOpaque(true);
         errorTab.add(errorPane);
         errorPane.setBounds(0,0,580,490);
         errorText.setEditable(false);
         errorPane.getViewport().add(errorText);
         errorText.setBounds(0,0,600,550);
         treePane.setAutoscrolls(true);
         treePane.setHorizontalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
         treePane.setVerticalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
         treePane.setOpaque(true);
         treeTab.add(treePane);
         treePane.setBounds(0,0,580,490);
         treeText.setEditable(false);
         treePane.getViewport().add(treeText);
         treeText.setBounds(0,0,600,550);
         //create the tabbed window           
    centerPane.setBorder(new javax.swing.border.EtchedBorder());
    formTab.setLayout(null);
    errorTab.setLayout(null);
    treeTab.setLayout(null);
    centerPane.addTab("Search Parameters", formTab);
    centerPane.addTab("Error Messages", errorTab);
    centerPane.addTab("Website Structure", treeTab);
              //add the tool bar and tabbed pane
              getContentPane().add(toolBar, java.awt.BorderLayout.NORTH);
    getContentPane().add(centerPane, java.awt.BorderLayout.CENTER);                    
              *create the tool bar pane, a center pane, add the buttons,
              *labels, tabs, a text field for user input here
              javax.swing.JPanel toolBar = new javax.swing.JPanel();
              javax.swing.JButton start = new javax.swing.JButton();
              javax.swing.JButton cancel = new javax.swing.JButton();
              javax.swing.JButton close = new javax.swing.JButton();      
              javax.swing.JTabbedPane centerPane = new javax.swing.JTabbedPane();
              javax.swing.JPanel formTab = new javax.swing.JPanel();
              javax.swing.JLabel urlLabel = new javax.swing.JLabel();
              javax.swing.JLabel current = new javax.swing.JLabel();
              javax.swing.JTextField url = new javax.swing.JTextField();
              javax.swing.JPanel errorTab = new javax.swing.JPanel();
              javax.swing.JTextArea errorText = new javax.swing.JTextArea();
              javax.swing.JScrollPane errorPane = new javax.swing.JScrollPane();
              javax.swing.JPanel treeTab = new javax.swing.JPanel();
              javax.swing.JTextArea treeText = new javax.swing.JTextArea();
              javax.swing.JScrollPane treePane = new javax.swing.JScrollPane();
              javax.swing.JTree searchTree = new javax.swing.JTree();
              *show the gui
              public static void main(String args[])
              (new gui()).setVisible(true);
         *listen for the button presses and set the
         *boolean flag depending on which button is pressed
         class ButtonListener implements ActionListener
              public void actionPerformed(ActionEvent event)
                   Object object = event.getSource();
                   if (object == start)
                        run = true;
                        startActionPerformed(event);
                   if (object == cancel)
                        run = false;
                        startActionPerformed(event);
                   if (object == close)
                        System.exit(0);
         *this method is called when the start or
         *cancel button is pressed.
         void startActionPerformed (ActionEvent event)
              if (run == true && bgThread == null)
                   bgThread = new Thread(this);
                   bgThread.start();
              if (run == false && bgThread != null)
                   webSpider.cancel();
         *this mehtod will start the background thred.
         *the background thread is required so that the
         *GUI is still displayed
         public void run()
              try
                   webSpider = new WebSpider(this);
                   webSpider.clear();
                   urlInput = new URL(url.getText());
                   webSpider.addURL(urlInput);
                   webSpider.run();
                   bgThread=null;
              catch (MalformedURLException e)
                   addressError addErr = new addressError();
                   addErr.addMsg = "URL ERROR - PLEASE CHECK";
                   SwingUtilities.invokeLater(addErr);
              *this method is called by the web spider
              *once a url is found. Validation of navigation
              *happens here.
              public boolean urlFound(URL urlInput,URL url)
                   CurrentlyProcessing pro = new CurrentlyProcessing();
              pro.msg = url.toString();
              SwingUtilities.invokeLater(pro);
              if (!testLink(url))
                        navigationError navErr = new navigationError();
                        navErr.navMsg = "Broken Link "+url+" caused on "+urlInput+"\n";
                        return false;
              if (!url.getHost().equalsIgnoreCase(urlInput.getHost()))
                   return false;
              else
                   return true;
              *this method is called internally to check
         *that a link works
              protected boolean testLink(URL url)
              try
                   URLConnection connection = url.openConnection();
                   connection.connect();
                   return true;
              catch (IOException e)
                   return false;
         *this method is called when an error is
         *found.
              public void URLError(URL url)
              *this method is called when an email
              *address is found
              public void emailFound(String email)
              /*this method will update any errors found inc
              *address errors and broken links
              class addressError implements Runnable
                   public String addMsg;
                   public void run()
                        errorText.append(addMsg);
                        current.setText("Currently Processing: "+ addMsg);
              class navigationError implements Runnable
                   public String navMsg;
                   public void run()
                        errorText.append(navMsg);
              *this method will update the currently
              *processing field on the GUI
              class CurrentlyProcessing implements Runnable
              public String msg;
              public void run()
                   current.setText("Currently Processing: " + msg );
    //webspider.java
    import java.util.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    import javax.swing.tree.*;
    import javax.swing.*;
    *this class implements the spider.
    public class WebSpider extends HTMLEditorKit
         *make a collection of the URL's
         protected Collection urlErrors = new ArrayList(3);
         protected Collection urlsWaiting = new ArrayList(3);
         protected Collection urlsProcessed = new ArrayList(3);
         //report URL's to this class
         protected gui report;
         *this flag will indicate whether the process
         *is to be cancelled
         protected boolean cancel = false;
         *The constructor
         *report the urls to the wui class
         public WebSpider(gui report)
         this.report = report;
         *get the urls from the above declared
         *collections
         public Collection getUrlErrors()
         return urlErrors;
         public Collection getUrlsWaiting()
         return urlsWaiting;
         public Collection getUrlsProcessed()
         return urlsProcessed;
         * Clear all of the collections.
         public void clear()
         getUrlErrors().clear();
         getUrlsWaiting().clear();
         getUrlsProcessed().clear();
         *Set a flag that will cause the begin
         *method to return before it is done.
         public void cancel()
         cancel = true;
         *add the entered url for porcessing
         public void addURL(URL url)
         if (getUrlsWaiting().contains(url))
              return;
         if (getUrlErrors().contains(url))
              return;
         if (getUrlsProcessed().contains(url))
              return;
         /*WRITE TO LOG FILE*/
         log("Adding to workload: " + url );
         getUrlsWaiting().add(url);
         *process a url
         public void processURL(URL url)
         try
              /*WRITE TO LOGFILE*/
              log("Processing: " + url );
              // get the URL's contents
              URLConnection connection = url.openConnection();
              if ((connection.getContentType()!=null) &&
         !connection.getContentType().toLowerCase().startsWith("text/"))
              getUrlsWaiting().remove(url);
              getUrlsProcessed().add(url);
              log("Not processing because content type is: " +
         connection.getContentType() );
                   return;
         // read the URL
         InputStream is = connection.getInputStream();
         Reader r = new InputStreamReader(is);
         // parse the URL
         HTMLEditorKit.Parser parse = new HTMLParse().getParser();
         parse.parse(r,new Parser(url),true);
    catch (IOException e)
         getUrlsWaiting().remove(url);
         getUrlErrors().add(url);
         log("Error: " + url );
         report.URLError(url);
         return;
    // mark URL as complete
    getUrlsWaiting().remove(url);
    getUrlsProcessed().add(url);
    log("Complete: " + url );
    *start the spider
    public void run()
    cancel = false;
    while (!getUrlsWaiting().isEmpty() && !cancel)
         Object list[] = getUrlsWaiting().toArray();
         for (int i=0;(i<list.length)&&!cancel;i++)
         processURL((URL)list);
    * A HTML parser callback used by this class to detect links
    protected class Parser extends HTMLEditorKit.ParserCallback
    protected URL urlInput;
    public Parser(URL urlInput)
    this.urlInput = urlInput;
    public void handleSimpleTag(HTML.Tag t,MutableAttributeSet a,int pos)
    String href = (String)a.getAttribute(HTML.Attribute.HREF);
    if((href==null) && (t==HTML.Tag.FRAME))
    href = (String)a.getAttribute(HTML.Attribute.SRC);
    if (href==null)
    return;
    int i = href.indexOf('#');
    if (i!=-1)
    href = href.substring(0,i);
    if (href.toLowerCase().startsWith("mailto:"))
    report.emailFound(href);
    return;
    handleLink(urlInput,href);
    public void handleStartTag(HTML.Tag t,MutableAttributeSet a,int pos)
    handleSimpleTag(t,a,pos); // handle the same way
    protected void handleLink(URL urlInput,String str)
    try
         URL url = new URL(urlInput,str);
    if (report.urlFound(urlInput,url))
    addURL(url);
    catch (MalformedURLException e)
    log("Found malformed URL: " + str);
    *log the information of the spider
    public void log(String entry)
    System.out.println( (new Date()) + ":" + entry );
    I have a seperate class for parseing the HTML. Any help would be greatly appreciated
    mrv

    Hi Sorry to be a pain again,
    I have re worked the gui class so it looks like this now:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import javax.swing.event.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    public class gui extends JFrame implements Runnable
         *declare variable, boolean
         *thread, a object and a center
         *pane
         protected URL urlInput;
         protected Thread bgThread;
         protected boolean run = false;
         protected WebSpider webSpider;
         public String msgInfo;
         public String brokenUrl;
         public String goodUrl;
         public String deadUrl;
         protected DefaultMutableTreeNode rootNode;
    protected DefaultTreeModel treeModel;
         public gui()
              *create the gui here
              setTitle("Testing Tool");
         setSize(600,600);
         //add Buttons to the tool bar
         start.setText("Start");
         start.setActionCommand("Start");
         toolBar.add(start);
         ButtonListener startListener = new ButtonListener();
              start.addActionListener(startListener);
              cancel.setText("Cancel");
         cancel.setActionCommand("Cancel");
         toolBar.add(cancel);
         ButtonListener cancelListener = new ButtonListener();
              cancel.addActionListener(cancelListener);
              close.setText("Close");
         close.setActionCommand("Close");
         toolBar.add(close);
         ButtonListener closeListener = new ButtonListener();
              close.addActionListener(closeListener);
              //creat a simple form
              urlLabel.setText("Enter URL:");
              urlLabel.setBounds(100,36,288,24);
              formTab.add(urlLabel);
              url.setBounds(170,36,288,24);
              formTab.add(url);
              current.setText("Currently Processing: ");
              current.setBounds(100,80,288,24);
              formTab.add(current);
         //add scroll bars to the error messages screen and website structure
         errorPane.setAutoscrolls(true);
         errorPane.setHorizontalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
         errorPane.setVerticalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
         errorPane.setOpaque(true);
         errorTab.add(errorPane);
         errorPane.setBounds(0,0,580,490);
         errorText.setEditable(false);
         errorPane.getViewport().add(errorText);
         errorText.setBounds(0,0,600,550);
         treePane.setAutoscrolls(true);
         treePane.setHorizontalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
         treePane.setVerticalScrollBarPolicy(javax.swing.
         ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
         treePane.setOpaque(true);
         treeTab.add(treePane);
         treePane.setBounds(0,0,580,490);
         treeText.setEditable(false);
         treePane.getViewport().add(treeText);
         treeText.setBounds(0,0,600,550);
         //JTree
         // NEW CODE
         rootNode = new DefaultMutableTreeNode("Root Node");
         treeModel = new DefaultTreeModel(rootNode);
         treeModel.addTreeModelListener(new MyTreeModelListener());
         tree = new JTree(treeModel);
         tree.setEditable(true);
         tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    tree.setShowsRootHandles(true);
         treeText.add(tree);
         //create the tabbed window           
    centerPane.setBorder(new javax.swing.border.EtchedBorder());
    formTab.setLayout(null);
    errorTab.setLayout(null);
    treeTab.setLayout(null);
    centerPane.addTab("Search Parameters", formTab);
    centerPane.addTab("Error Messages", errorTab);
    centerPane.addTab("Website Structure", treeTab);
              //add the tool bar and tabbed pane
              getContentPane().add(toolBar, java.awt.BorderLayout.NORTH);
    getContentPane().add(centerPane, java.awt.BorderLayout.CENTER);     
              *create the tool bar pane, a center pane, add the buttons,
              *labels, tabs, a text field for user input here
              javax.swing.JPanel toolBar = new javax.swing.JPanel();
              javax.swing.JButton start = new javax.swing.JButton();
              javax.swing.JButton cancel = new javax.swing.JButton();
              javax.swing.JButton close = new javax.swing.JButton();      
              javax.swing.JTabbedPane centerPane = new javax.swing.JTabbedPane();
              javax.swing.JPanel formTab = new javax.swing.JPanel();
              javax.swing.JLabel urlLabel = new javax.swing.JLabel();
              javax.swing.JLabel current = new javax.swing.JLabel();
              javax.swing.JTextField url = new javax.swing.JTextField();
              javax.swing.JPanel errorTab = new javax.swing.JPanel();
              javax.swing.JTextArea errorText = new javax.swing.JTextArea();
              javax.swing.JScrollPane errorPane = new javax.swing.JScrollPane();
              javax.swing.JPanel treeTab = new javax.swing.JPanel();
              javax.swing.JTextArea treeText = new javax.swing.JTextArea();
              javax.swing.JScrollPane treePane = new javax.swing.JScrollPane();
              javax.swing.JTree tree = new javax.swing.JTree();
              *show the gui
              public static void main(String args[])
              (new gui()).setVisible(true);
         *listen for the button presses and set the
         *boolean flag depending on which button is pressed
         class ButtonListener implements ActionListener
              public void actionPerformed(ActionEvent event)
                   Object object = event.getSource();
                   if (object == start)
                        run = true;
                        startActionPerformed(event);
                   if (object == cancel)
                        run = false;
                        startActionPerformed(event);
                   if (object == close)
                        System.exit(0);
         *this method is called when the start or
         *cancel button is pressed.
         void startActionPerformed (ActionEvent event)
              if (run == true && bgThread == null)
                   bgThread = new Thread(this);
                   bgThread.start();
                   //new line of code
                   treeText.addObject(msgInfo);
              if (run == false && bgThread != null)
                   webSpider.cancel();
         *this mehtod will start the background thred.
         *the background thread is required so that the
         *GUI is still displayed
         public void run()
              try
                   webSpider = new WebSpider(this);
                   webSpider.clear();
                   urlInput = new URL(url.getText());
                   webSpider.addURL(urlInput);
                   webSpider.run();
                   bgThread = null;
              catch (MalformedURLException e)
                   addressError addErr = new addressError();
                   addErr.addMsg = "URL ERROR - PLEASE CHECK";
                   SwingUtilities.invokeLater(addErr);
              *this method is called by the web spider
              *once a url is found. Validation of navigation
              *happens here.
              public boolean urlFound(URL urlInput,URL url)
                   CurrentlyProcessing pro = new CurrentlyProcessing();
              pro.msg = url.toString();
              SwingUtilities.invokeLater(pro);
              if (!testLink(url))
                        navigationError navErr = new navigationError();
                        navErr.navMsg = "Broken Link "+url+" caused on "+urlInput+"\n";
                        brokenUrl = url.toString();
                        return false;
              if (!url.getHost().equalsIgnoreCase(urlInput.getHost()))
                   return false;
              else
                   return true;
              *this method is returned if there is no link
              *on a web page, e.g. there us a dead end
              public void urlNotFound(URL urlInput)
                        deadEnd dEnd = new deadEnd();
                        dEnd.dEMsg = "No links on "+urlInput+"\n";
                        deadUrl = urlInput.toString();               
              *this method is called internally to check
         *that a link works
              protected boolean testLink(URL url)
              try
                   URLConnection connection = url.openConnection();
                   connection.connect();
                   goodUrl = url.toString();
                   return true;
              catch (IOException e)
                   return false;
         *this method is called when an error is
         *found.
              public void urlError(URL url)
              *this method is called when an email
              *address is found
              public void emailFound(String email)
              /*this method will update any errors found inc
              *address errors and broken links
              class addressError implements Runnable
                   public String addMsg;
                   public void run()
                        current.setText("Currently Processing: "+ addMsg);
                        errorText.append(addMsg);
              class navigationError implements Runnable
                   public String navMsg;
                   public void run()
                        errorText.append(navMsg);
              class deadEnd implements Runnable
                   public String dEMsg;
                   public void run()
                        errorText.append(dEMsg);
              *this method will update the currently
              *processing field on the GUI
              public class CurrentlyProcessing implements Runnable
                   public String msg;
              //new line
              public String msgInfo = msg;
              public void run()
                   current.setText("Currently Processing: " + msg );
         * NEW CODE
         * NEED THIS CODE SOMEWHERE
         * treeText.addObject(msgInfo);
         public DefaultMutableTreeNode addObject(Object child)
         DefaultMutableTreeNode parentNode = null;
         TreePath parentPath = tree.getSelectionPath();
         if (parentPath == null)
         parentNode = rootNode;
         else
         parentNode = (DefaultMutableTreeNode)
    (parentPath.getLastPathComponent());
         return addObject(parentNode, child, true);
         public DefaultMutableTreeNode addObject(DefaultMutableTreeNode parent,
    Object child)
         return addObject(parent, child, false);
         public DefaultMutableTreeNode addObject(DefaultMutableTreeNode parent,
         Object child,boolean shouldBeVisible)
         DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(child);
         if (parent == null)
         parent = rootNode;
         treeModel.insertNodeInto(childNode, parent, parent.getChildCount());
         if (shouldBeVisible)
         tree.scrollPathToVisible(new TreePath(childNode.getPath()));
              return childNode;
         public class MyTreeModelListener implements TreeModelListener
              public void treeNodesChanged (TreeModelEvent e)
                   DefaultMutableTreeNode node;
                   node = (DefaultMutableTreeNode)
                   (e.getTreePath().getLastPathComponent());
                   try
                        int index = e.getChildIndices()[0];
                        node = (DefaultMutableTreeNode)
                        (node.getChildAt(index));
                   catch (NullPointerException exc)
              public void treeNodesInserted(TreeModelEvent e)
              public void treeStructureChanged(TreeModelEvent e)
              public void treeNodesRemoved(TreeModelEvent e)
    I beleive that this line of code is required:
    treeText.addObject(msgInfo);
    I have placed it where the action events start the spider, but i keep getting this error:
    cannot resolve symbol
    symbol : method addObject (java.lang.String)
    location: class javax.swing.JTextArea
    treeText.addObject(msgInfo);
    Also the jtree is not showing the window that I want it to and I am not too sure why. could you have a look to see why? i think it needs a fresh pair of eyes.
    Many thanks
    MrV

  • On right click, the focus is not set on tree node.

    Dear members,
    I have a tree and a database block, when i right click on a tree node, the focus is not set on the node.
    If I first click on the node and then right click on selected node it populate the database block.
    But I want to populate the datablock on right click.
    how to implement it?
    Regards:

    No body ever encountered this problem?
    Any advice would be appreciated.
    Thanks

  • Invalid B-tree node and disk stuck

    Last night my 2 year old iMac froze up. When I re-started I received the flashing question-mark folder. I ended up inserting my OS X install disk and attempting to run the Disk Utility. I tried to repair the disk, but got the "Invalid B-tree node size" error with "The volume needs to be repaired."
    I have tried a lot of things and will probably end up buying Disk Warrior and hoping that fixes it. BUT, I have another problem. I can't eject the OS X install disk. The option to eject is greyed out on the Disk Utility, the eject key doesn't work, and I can't find any way to unload the disk. Help would be appreciated.

    If you have an external hard drive it would be easier to clone your system to the external then boot to the external and run Disk Warrior from there. However if your system won't boot in the first place that won't work. You could pick up a copy of Disk Warrior from the Apple store.
    http://www.bombich.com/software/ccc.html
    George

  • Custom tree node and DefaultTreeModel

    Hello,
    I would like to know if it's possible to use the following custom tree node with the DefaultTreeModel:
    class MyTreeNode extends DefaultMutableTreeNode{
      private String _argument = null;
      public MyTreeNode(){}
      public MyTreeNode(Object node, String argument){
         super(node);
          _argument = argument;
    }I have tried it and it's not working but I think in theory it should work. Please correct me if I'm wrong.
    The problem is that the tree won't display or insert the custom node when the insertNodeAt(...) method of
    the DefaultTreeModel is called. I also tried using a custom tree listener and calling the .reload() method directly.
    Any help will be very appreciated.
    Thanks in advanced.

    Are you sure it's not being inserted into the model,
    and just not being displayed?
    Are you calling nodesWereInserted() after your
    insertion?Thanks for your reply.
    I've modified my app. so that the following method will populate the tree for testing only:
      public void populateTree()
        MyTreeNode root = new MyTreeNode("Root Node", "test");
        DefaultTreeModel treeModel = new DefaultTreeModel(root);
        JTree tree = new JTree(treeModel);
        tree.setEditable(true);
        tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
        tree.setShowsRootHandles(true);
        JScrollPane scrollPane = new JScrollPane(tree);
        setLayout(new GridLayout(1,0));
        add(scrollPane);
        int childIdx[] = {0,1};
        String p1Name = new String("Parent 1");
        String p2Name = new String("Parent 2");
        String c1Name = new String("Child 1");
        String c2Name = new String("Child 2");
        MyTreeNode p1 = new MyTreeNode(p1Name, "test");
        MyTreeNode p2 = new MyTreeNode(p2Name, "test");
        MyTreeNode c1 = new MyTreeNode(c1Name, "test");
        MyTreeNode c2 = new MyTreeNode(c2Name, "test");
        treeModel.insertNodeInto(p1, root, 0);
        treeModel.insertNodeInto(p2, root, 1);
        treeModel.nodesWereInserted(root, childIdx);
        treeModel.insertNodeInto(c1, p1, 0);
        treeModel.insertNodeInto(c2, p1, 1);
        treeModel.nodesWereInserted(p1, childIdx);
        treeModel.reload();
    }And the result is that the "Root Node" will be displayed with "Parent1" and "Parent2" but "Parent1" won't have any children. Furthermore, if I try to remove "Parent1" using:
    treeModel.removeNodeFromParent(p1);I will get an exception saying that node p1 has no parent, which suggests that the parent/child relation
    is not being assigned by the model, even though the nodes (p1, p2) are displayed in the tree showing "Root node" as the parent. This is very strange.
    Please help.

  • Create a tree node and show the report on the same page

    Hi,
    I have created a tree for our organization and each node represents a unit. The top one is office level and followed by division and brach.
    I have created a reprot on the same page as the tree node.
    What I want to do is:
    I would like to click a specific node and the report shows only that node and bellow. So, If I click division A and division A has two branch. my report shows only those two braches that bellong to division A.
    Can someone help me?
    Thank you

    The only way it could work is using iframes. Now OBIEE 11g would not allow iframes inside it's dashboard. It offers a dashboard object called "Embedded content" which is a restricted iframe kinda thing but unless you get this object's id from generated HTML you can change it's content dynamically. Besides, such an implementation may break with next patch. So here is an idea.
    Create a HTML page with two iframes, left one will hold all the reports with links (you can always generate a list of reports through catalog manager, open it in excel and make HTML links from it) that open report urls (in the format of ./saw.dll?GO&Path=....) in right iframe (using javascript open.window method). Once that page is working, call this page from dashboard using an action link. This is slightly twisted approach but at least it would give you what you asked for.
    About making the report list dynamic, I am afraid there are no easy answers. OBIEE provides web service that will allow the users to query catalog to get a list of reports. You can try some basic JSP to access the web service and generate the list dynamically. But that is not something I can provide here.

  • Skin Text of ADF Tree Node and Leaf separately

    Hi,
    Is it possible to skin a tree (ADF 11g), so that the text of a node is white on black, and text of a leaf is black on white?
    I know I can change the icons for a node and a leaf separately , but can't find how to change the styles of the text seperately.
    Groeten,
    HJH

    Hi,
    1. Thanks.. i did understand...I am creating a tree with region-countries-location... so when i drag and drop the region view as a tree ... I get a default code like this
    <af:tree value="#{bindings.RegionsView1.treeModel}" var="node"
    selectionListener="#{bindings.RegionsView1.treeModel.makeCurrent}"
    rowSelection="single" id="t1">
    <f:facet name="nodeStamp">
    <af:outputText value="#{node}" id="ot1" />
    </f:facet>
    </af:tree>
    In this i have used output text ... so how do i use the styleclass.... I am a new bie so can u also tel me how to use implement the same and alsohow to create a styleclass..........
    2. I have to display a seperate icons for parent node and leaf nodes.. can u tel me how to achieve this also...
    Can u provide me ur sample and also docs so that it would be helpful...
    Id: [email protected]
    Thx.. waiting for your reply

  • Showing tree nodes and leaves

    Hi,
    I have a tree control populated by XML data. In my tree I
    would like to show only the nodes and not the leaves. Is this
    possible?
    Thanks,
    Janie

    co-workers said example picture is misleading.. we can make the order work if everything is a "folder" but not a mix of "folders" and "files" (if making a visual reference to the windows browser). i.e - a file is represented as an empty folder.
    TK1    
    . Mat1
    . Mat2
    . mat3
    > kit1   
    .. comp1
    .. comp2
    .. comp3
    . mat4
    > kit2
    .. comp4
    .. comp5
    .. comp6
    . mat5
    displays at
    TK1
    > kit1
    .. comp1
    .. comp2
    .. comp3
    > kit2
    .. comp4
    .. comp5
    .. comp6
    . mat1
    . mat2
    . mat3
    . mat4
    . mat5
    we can make it work if everything is a folder. This is our current workaround.
    TK1
    > mat1
    > mat2
    > mat3
    v kit1 (when expanded)
    .. comp1
    .. comp2
    .. comp3
    > mat4
    > kit2 (when not expanded)
    > mat5

  • Invalid b-tree node and the disk can't be repaired.  Is it worth the reformat or is the hard drive trashed?  This is a Mac mini, I've had it since 2010 and already had to replace the hard drive once.

    Swapped out the monitor on my Mac mini tonight and it wouldn't start back up.  Managed to boot off the install disk and run disk utility, which gave the invalid b tree node error.  Wasn't able to repair the disk, suggested a reformat.  Is this worth my time?  Or is the disk toasted?  I got it in 2010, it's out of warranty and has already had the hard drive replaced once.  Thanks!
    -laura

    If you want to save the data from the drive, Phoenix might be able to copy (clone) it off on another volume. You can check it out at:
    http://scsc-online.com/Phoenix.html
    Phoenix does a file copying cloning, not block copy cloning, so a new index is generated on the drive when the copy is being made. If none of the files got lost, meaning just the index is screwed up, I would think this would work.
    Regarding the hard drive an index problem isn't a hard drive problem. That hard drive may be in perfect working order, especially since it's fairly new.

  • Setting different tree nodes icons

    Hello.
    I know this thread was discussed and i read it but it did not helped me.
    I need a tree that might look like this:
    +hostname
    +---database1
    --table1
    --table2
    --table3
    +---database2
    --table1
    --table2
    --table3
    This is a database tree.
    Now my code to set different icons is:
    public class DMSTreeCellRenderer extends DefaultTreeCellRenderer {
        private DatabaseInfo databaseInfo;
        private String dbHost;
         /** Creates a new instance of DMSTreeCellRenderer */
        public DMSTreeCellRenderer(String dbHost) {
            this.dbHost = dbHost;
        public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
            ImageIcon rootIcon = new ImageIcon("resources/images/database.png");
            ImageIcon tableIcon = new ImageIcon("resources/images/database_table.png");
            if(tree.getModel().getRoot().toString().equals(dbHost) ) {
                setIcon(new ImageIcon("resources/images/server_database.png"));
                isFirstSetup = false;
            if (rootIcon != null && tableIcon !=null) {
                setClosedIcon(rootIcon);
                setOpenIcon(rootIcon);
                setLeafIcon(tableIcon);
            return super.getTreeCellRendererComponent(tree,value,sel,expanded,leaf,row,hasFocus);
    }Anyway it does not work. like it should. The root nod has the same icon like the childs :(

    Thank you for your help, i solve my problem like this:
    public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
            super.getTreeCellRendererComponent(tree,value,sel,expanded,leaf,row,hasFocus);
            ImageIcon rootIcon = new ImageIcon("resources/images/database.png");
            ImageIcon tableIcon = new ImageIcon("resources/images/database_table.png");
            if(value.toString().equals(dbHost) ){
                setIcon(new ImageIcon("resources/images/server_database.png"));
            }else {
                if (rootIcon != null && tableIcon !=null) {
                    if(leaf){
                        setIcon(tableIcon);
                    }else {
                        setIcon(rootIcon);   
            return this;
        }

  • Problem with Finder and Menu Fonts (uppercase A)

    Hello --
    I'm having a problem with fonts. All the characters that appear under icons in the Finder or in the menu for any application appear as uppercase As with boxes around them. There appears to be one uppercase A for each character that should be there. If I click-pause-click to edit the filename in the Finder, the text appears normal during the duration of the change, and then reverts to uppercase A with a box around it again. All other operation of the computer is normal.
    I was watching and downloading video files in iTunes when the problem appeared. When I pressed ESC to exit full-screen mode, the Finder said that my start-up disk was almost full, and I saw the font problem. Upon investigating, I discovered that my start-up disk was completely full (and the download had failed), so the first thing I did was move some video files to an external drive, which freed about 5 GB.
    Since freeing the space, I've tried the following to fix it, in this order:
    1. booted from Tiger CD to run Repair Disk from Disk Utility
    2. rebooted from the boot hard drive to run Repair Disk Permissions from Disk Utility
    3. run through Disk Warrior
    4. created a test admin user and logged in as that user
    5. removed font cache files using terminal
    6. booted in safe mode, logged in as myself, and then rebooted normally
    None of these actions has had any effect. The computer is still operating normally, except for the characters that don't display correctly.
    I'm running 10.4.6 on a Titanium Powerbook 500 MHz with 512MB RAM. A few months ago, I replaced the internal hard drive with an 80GB Seagate.
    Tibook 500   Mac OS X (10.4.6)  

    Hi again, zoobieboots —
    I appreciate your initiating a new thread. Your post here helps to make the situation much clearer than in bmewolf's thread — particularly in terms of what you've already tried. Thanks again.
    A few initial thoughts —
        (a) As I was trying to suggest previously, you're apparently operating (after moving some files to an external drive) with ~6-10% (?) free disk space. Particularly given that you were working with large video files when this appeared, File fragmentation would be expected. While I haven't heard of this particular symptom resulting from fragmentation, that would be a concern to me — particularly since this immediately preceded the problematic behavior.
    I've read some good reports about iDefrag, but haven't used it myself. A demo version is apparently available for HDs < 100GB. But you'd presumably need to free significantly more space first (you haven't actually said whether 5GB or ?? is the total available now). Having never experienced severe fragmentation, I don't fully understand its consequences — but another participant may be able to explain this.
        <b>(b) You don't mention trying to troubleshoot potentially corrupt or incompatible fonts (or font caches), also as outlined in the other thread. As I suggested there, The X Lab's "undoing Font Book" FAQ is a useful resource in this.
        (c) Although I agree it may be an unsatisfying "solution," an Archive & Install did work for bmewolf in the case that you've indicated matches yours closely.
    I hope one of these suggestions is helpful. Please post back to discuss your progress.
    Regards,
    Dean

  • Dynamic add tree node and thread

    Hi,
    I implemented a thread by using SwingWorker class to execute the time-consuming file loading and processing task instead of the event-dispatching thread. However, I need to dynamically add node to a tree by using data returned by the file loader in my project's main frame like following:
    if (source == loadAffyItem) {
        //load affy file data to the application
        loader = new AffyFileLoader();
        //dynamically add node to the tree after data loading
        rawDataNode = treePanel.addObject(null, "Raw Data");
        DefaultMutableTreeNode node = new DefaultMutableTreeNode(new UserData("Pixel",   loader.getPixelMatrix()));
        pixelNode = treePanel.addObject(rawDataNode, node);
        node = new DefaultMutableTreeNode(new UserData("Signal", loader.getSignalMatrix()));
        signalNode = treePanel.addObject(rawDataNode, node);
    }However, I always get a NullPointer error by doing this way since the code to dynamically add node to the tree using data returned from loader, but the loader is executed
    in another thread and not finished yet. How could I make that code executed after the loader class is finished? Hope you could enlight me about this issue?
    thanks in advance!
    Jenny

    You'll have to redesign a bit. You could either have the separate thread add the node when it's finished (using SwingUtilities invokeLater to ensure you're updating the GUI in the Event Dispatch thread), or you could have the separate thread call-back or send an event when it's finished (and your main thread would listen).

  • Setting a tree node noneditable

    Hallo,
    The nodes in my JTree can come out of three classes, I need to set 2 of them noneditable and the third one editable (changing the name/text of the node).
    I have no idea how to achieve this, any help please?
    Ralf
    Edited by: Ralf-Meermeier on Aug 8, 2008 8:02 AM

    Try extending the node class to something like:
    public class editableNode extends node{
        ...and adding a valiable:
        private boolean canBeEdited;as well as a method:
    public void setEditable(boolean b){
        canBeEdited = b;
    }Then you can override the functional methods:
    public void doStuff(){
        if(canBeEdited) super.doStuff();
    }Hope that helps,
    pieman

  • Display Checkbox along Tree node and its child elements

    Experts,
    I want to display a checkbox in front of the Tree displayed in the view. This is used for me to select the child item value for my selection condition.
    let say if the user selects the node, all the child elements will be used for search condition.
    Otherwise, if the node is expanded, then the checkbox selected in the child element will be used for search condition...
    Can u ppl suggest me how to design it, if possible can u share some sample code or procedure to customize the Tree as per the requirement...
    thanx in advance,
    James...

    hi
    please go through this
    <a href="http://integration  of  a  tree  structure  in  a  web  dynpro  table">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/de59f7c2-0401-0010-f08d-8659cef543ce</a>
    Thanks
    Smitha

Maybe you are looking for

  • Iphone remote will not connect to itunes

    I have the downloaded iTunes 11 and the latest Remote App last night with hopes my problem would be resolved.  For about 6 months I have not been able to connect my iphone 4S (6.0.1) to my imac.  I've restarted the router, phone and computer are on t

  • No. of hidden fields in a jsp..

    Hi, I would like to know if there is any limit to the no. of hidden fields in a jsp page. What effect does the page/browser have if there are many hidden fields(like about say 50) in a single page. any ideas. thanks jag

  • Failing to install/download PSE 11 for mac

    Hey, I have bought PSE 11 for windows a year ago and now would like it to install it on my new mac machine. In my orders, I only can download a windows installer. I have searched in the forum and found the following link to download a mac version: ht

  • Formatting N73ME

    Hii guys...I'm a new member at this place and I soo regret nor being here earlier...IT's Freaking AMAZING!!!! :-) ok.....the thing is...I've got a N73ME for around 6 months now....loads of known issues keep troubling me...like the back camera not wor

  • Should I buy this used MacBook??

    I'm thinking of buying a used MacBook (I have to return the one I have from work because I am changing jobs)...it's almost 3 years old and here are the specs: Specs: 2.2 GHz Intel Core 2 Duo processor 2 GB RAM 250 GB hard drive Built-in dual-layer Su