How to set JTree lines invisible?

Hi all,
I have tried it with adding following code while GUI is initializing.
here i'm using a custom TreeCellRenderer. But still line are visible :(
MyTreeCellRenderer renderer = new MyTreeCellRenderer();
renderer.setBackgroundSelectionColor(new Color(0xffffff));
renderer.putClientProperty("JTree.lineStyle", "None");
setCellRenderer(renderer);How to get the thing done correctly?
kaushalya

This client property should be set to the tree, not the renderer.
Anyway it will only work in Java look and feel (Metal).
Read the tutorial: [Customizing a Tree's Display|http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html#display]

Similar Messages

  • How to set border lines in table and also in template in the smartforms ?

    How to set border lines in table and also in template in the smartforms ?
    As I have to create table with following detals
    total row = 3
    row1 = 3 column
    row2 = 6 column
    row3 = 9 column
    for 2nd and 3rd row data to be fetched using coding.
    so can anybody explain me what should i use
    Table or Template ?
    and I want the border like excel format.
    Can anybody suggest me ?
    Thanks
    naresh

    if the data is multiple i.e. line items choose table.
    if the data is single i.e. fixed choose template.
    Create table
    >  Draw u r no lines
    > choose option select pattern
    > select display framed patterns
    Choose u r required one.
    out lined, or full lined. u can choose option.
    same procedure to be followed for template also.
    with regards,
    Kiran.G

  • How to set a line of table as read only during runtime?

    How to set a line (or a cell) of table as read only during runtime?

    hi wei
          when you create a table keep the readonly property of table as false
    you create the columns of table as inputfield.you bind the readonly property of
    the inputfield to two context variables
    say one for all the columnfields you to want always have as readonly and let this contextattribute of type boolean and let this be attr1
    and another for all the columnfields you donot want to be readonly and let this contextattribute of type boolean and let this be attr2
    initially set the context attributes attr1 and attr2 as true so the entire table is readonly.
    based on the condition you want to check change the attr2 to be false.
    if(your condition)
    wdcontext.currentcontextelement.setattr2(false);
    hope this helps.
    regards
    saravana

  • How to set a layer invisible?

    Hi guys,
    Can you tell me how to set a layer invisible? Thanks.

    function hideAllLayers()<br />{<br />     forEach(document.layers, function(layer) {<br />          layer.visible = false;<br />     });<br />}<br /><br />function showAllLayers()<br />{<br />     forEach(document.layers, function(layer) {<br />          layer.visible = true;<br />     });          <br />}<br /><br />function forEach(collection, fn)<br />{<br />     var n = collection.length;<br />     for(var i=0; i<n; ++i)<br />     {<br />          fn(collection[i]);<br />     }<br />}

  • How to set dash line color(two colors)?

    hello all:
    Does anyone know how to set dash line color in java?
    I only know how to set line color with a single color.
    g2.setColor(Color.black);
    g2.setStroke(dashed);
    g2.draw(new Rectangle2D.Double(50, 50, 200,100));
    what I need to implement is two colors interleave on the dash line.
    so that dash line looks like this:
    ==== ====
    red white red white
    thank you for any comments.
    -Daniel.

    create 2 strokes, space them appropriately, draw the rectangle twice.

  • How to set vertical line in SAPScript

    Dear All,
    I have to set vertical line at a particular position of SAPScript. Here the lines are of varying length. Can you suggest how to do that?
    Line 1......................            | Vertical Line
    Line 2.........................         | Vertical Line
    Line 3...............                   | Vertical Line
    Thanks and regards,
    Atanu

    Hii
    use this
    BOX WIDTH 0 FRAME 10
    BOX HEIGHT 0 FRAME 10 
    BOX WIDTH 5 CM  HEIGHT 1 CM FRAME 10 TW INTENSITY 10
    BOX WIDTH 7 CM  HEIGHT 5 CM FRAME 10 TW INTENSITY 10
    HOPE THIS HELPS
    Thanks & Regards
    Naresh

  • How to Set a line's BackGroundColor in JTextPane?

    I want to change a whole line's(not only the characters) background color.(display as we set breakpoint in a debug environment).
    i tried
    DefaultStyleDocument.setCharacterAttributes(start,end-start,MyAttr, false);
    This can not set whole line but the begin to the end of the characters in line.
    Help,and Thanks

    This isn't exactly what you want, but it may give you some idea on how to approach it.
    import java.awt.*;
    import java.net.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class BackgroundLines extends JFrame
         public BackgroundLines()
              throws Exception
              JTextArea textComponent = new JTextArea()
                   public void paintComponent(Graphics g)
                        Rectangle drawHere = g.getClipBounds();
                        int lineHeight = g.getFontMetrics().getHeight();
                        int startOffset = getInsets().top;
                        int start = (drawHere.y / lineHeight) * lineHeight + startOffset;
                        int startLineNumber = (drawHere.y / lineHeight);
                        int endLineNumber = startLineNumber + (drawHere.height / lineHeight) + 1;
                        for (int i = startLineNumber; i <= endLineNumber; i++)
                             g.setColor( i % 2 == 0 ? getBackground() : Color.lightGray );
                             g.fillRect(drawHere.x, start, drawHere.width, lineHeight);
                             start += lineHeight;
                        super.paintComponent(g);
              textComponent.setOpaque( false );
              JScrollPane scrollPane = new JScrollPane(textComponent);
              scrollPane.setPreferredSize(new Dimension(300, 250));
              getContentPane().add( scrollPane );
         public static void main(String[] args)
              throws Exception
              BackgroundLines frame = new BackgroundLines();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setVisible(true);
    }

  • How to set focus on invisible input field?

    Hi Guys,
    I need an invisible input field and have to set an input focus on it. My problem is that if I set input field’s property visible=blank, I get my invisible field <b>BUT</b> the function call doesn’t work (setInput.requestFocus()).
    I suppose that I can’t set a focus if an input field is invisible.
    Does somebody know how can I solve my problem? Is there a possibility to do this input field invisible with java script? If yes, how does it work in Web Dynpro?
    Thanks
    Marita

    Hi
      Setting a focus on invisible input field will not work even if you follow the method what sowjanya has suggested. The method wdThis.wdGetAPI().requestFocus() will not work for read-only and disabled fields.
    By the way why do you want to set the focus on a invisible input field. If you can tell us the requirement maybe we could think of an alternate solution. But i guess for the current scenario setting focus on invisible input field does not work.
    regards
    ravi

  • How to set divider line in Project Task List?

    Hi
    Does anyone know how to set the position of the divider line in project task list?
    Thanks

    Hi,
    As I understand, you would like to customize divider line between task list view and grantt view.
    You could press F12 to locate the CSS code of this line, then customize it via CSS style code.
    In addition, the line could move by clicking it via Mouse. If you think Gantt view is not clear enough, you could click Zoom in or Zoom out to adjust it.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Re: How to set the line height of a Label?

    In Java 8, set the graphic of the label to a TextFlow with line spacing set.
    Text text = new Text("This is my\nspaced text.");
    TextFlow flow = new TextFlow(text);
    flow.setLineSpacing(13); // default font size is 13px, so this effectively makes the text double spaced, e.g. one line of text, one blank line, another line of text, another blank line, etc.
    Label label = new Label();
    label.setGraphic(flow);
    For Java 7, I don't know how you would set line spacing for a label.

    In Java 8 you can do it even more simply:
    Label label = new Label("This is my\nspaced text");
    label.setLineSpacing(13);
    The line spacing property can also be set with css:
    .label {
    -fx-line-spacing: 13;
    Of course, none of that actually helps to do this in Java 7. If you're not wrapping the text, you can fairly easily split the text at new lines, and add a label for each line to a VBox, specifying the spacing for the VBox as required.
    If you're wrapping text, trying something similar gets ugly rather quickly.

  • How to set primary line...

    Hello,
    I'm currently using a PAP2T with the two lines enabled.  I would like to configure the adapter so that all incoming calls will only come to one of the lines.  Is this possible?  How do I do this?
    Thanks,

    Hi,
    Line1 - register YES, call without registration NO (YES is also possible, but NO will cause no dialtone when registration fails), IP dialing YES
    => primary line, this one will be ringing one as sendng "regstration" makes the VoIP provider aware of the "alive" device and where to send "calls"
    => register YES makes it a "primary" line, call without registration NO makes dialtone on this line only appears when device is registerred.
    Line2 - register NO, call without registration YES, IP dialing YES
    => secondary line, not ringing on incomming calls, VoIP operator will not "know" about this line except if it's calling
    => register NO makes it a "secondary" line, call without registration YES makes dialtone sound on this line anytime and allows calls
    =================
    => IP dialing YES is not related to your problem, it's only handy "nice_to_have" feature allowing adapter/YOU to call IP address of another
         similar VoIP adapter/VoIP phone on any IP address it can directly reach ... without involving VoIP operator ... and thus free
         (this works for adapters in same network, and/or for adapter sitting on public IP addresses or with port redirects from public IP addresses)
         this can be useffull for friends - your friend has to tell you what his/her IP address/port is ... and you can call.
    For example, to call "number" 55577923 on IP address 86.97.108.209 port 5061 you will dial this on your phone :
    55577923*86*97*108*209*5061 ... (in fact, you call sip:[email protected]:5061) - if such an adapter with
    the given number shall be connected on the mentioned IP address and set SIP port to 5061, the adapters will talk directly.

  • How to set the fields invisible/visible dynamically with screen-exits

    <b>Goal:</b> I am changing the subscreen from standard screen for mobile device interface, i.e. function group LMOB. With a scanner I am to read a material number and have it confirmed by the SAP system. For this I need an input field which is already supplied by the standard program. The users require the screen to be dynamic, i.e. I can not do the settings in the screen-painter.
    <b>Problem occurred:</b> After I have changed to use the customized subscreen 1202 in function group XLRF, not all the fields are displayed. It seems that the values for setting the screen elements are lost when calling the subscreen (3202, copy of screen 2202). For instance, it does not show my input field. Somewhere there need to be a list that contains all these parameter switches? I know how “Loop at screen” works but can’t find the values that are supposed to be passed over to the subscreen.
    Would be grateful for some help.

    Hi Niklas!
    Unfortunately I don't know the transaction you're working on, but I had a similar problem once.
    You have to use the commands <b>LOOP AT SCREEN</b> and <b>MODIFY SCREEN</b>. I found some online help here: <a href="http://help.sap.com/saphelp_470/helpdata/en/9f/dba70535c111d1829f0000e829fbfe/frameset.htm">SAP Online Help</a>. The fields of the pseudo-table <b>SCREEN</b> can be found here: <a href="http://help.sap.com/saphelp_470/helpdata/en/9f/dbab6f35c111d1829f0000e829fbfe/frameset.htm">SAP Online Help</a>. I think you have to set <b>INVISIBLE</b> to 'X' - but you may have to experiment.
    Another thing to look out for is that you have to call this method in the <b>PBO</b> section of the dynpro. Take care no SAP logic is executed after your modification that changes your settings...
    Hope this helps (please reward me if it does),
    Joerg

  • How to set each line without gap??

    Hello!!
    Could any one help me in setting the records in each line without gap while printing? Right now, each record gets printed with one gap inbetween. I dont want the gap, rather I want to print the records in those gap so that the page usuage will be less, otherwise double usage.
    Regards
    Mitto

    check the Vertical Elasticity of your repeating frame and your fields. If you set it as Variable, it will not use the fixed space like it does now. Play with it and see how it works out for you.

  • How to set some line in ALV-OO as selected

    Hi,
    i use ALV-OO and will set some outputlines before first output as selected.
    Example:
    i have an output of 10 line. I will set line 2, 6, and 9 with default as selected because some valuy is greater as 1000.
    I will set it befaore the first output. Is this possible?
    Regards, Dieter

    Hi Himanshu,
    i have tested it and first it works like i want.
    But in second way i think in our case it's better to take editory checkboxes.
    Thanks for answer.
    Regards, Dieter

  • How to set Jtree Nodes' name into TextField??

    Dear Sir:
    I have following code to select any file's name then put into TextField,
    see:
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.io.File;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextField;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.tree.TreePath;
    public class JTreeSplitChooseDemo extends JPanel implements ActionListener{
        JFileChooser fc;
        JButton openButton, saveButton;
        JTextField jtf;
      public JTreeSplitChooseDemo() {
        final JTree tree;
        final JTextField jtf;
        JPanel jp= new JPanel();
        setPreferredSize(new Dimension(500,350));
        jp.setPreferredSize(new Dimension(500,300));
        DefaultMutableTreeNode top = new DefaultMutableTreeNode("Options");
        DefaultMutableTreeNode a = new DefaultMutableTreeNode("A");
        top.add(a);
        DefaultMutableTreeNode a1 = new DefaultMutableTreeNode("A1");
        a.add(a1);
        DefaultMutableTreeNode a2 = new DefaultMutableTreeNode("A2");
        a.add(a2);
        DefaultMutableTreeNode b = new DefaultMutableTreeNode("B");
        top.add(b);
        DefaultMutableTreeNode b1 = new DefaultMutableTreeNode("B1");
        b.add(b1);
        DefaultMutableTreeNode b2 = new DefaultMutableTreeNode("B2");
        b.add(b2);
        DefaultMutableTreeNode b3 = new DefaultMutableTreeNode("B3");
        b.add(b3);
        tree = new JTree(top);
        JScrollPane jsp = new JScrollPane(tree);
        jsp.setPreferredSize(new Dimension(500,300));
        tree.setPreferredSize(new Dimension(500,300));
        add(jsp, BorderLayout.CENTER);
        jtf = new JTextField("", 20);
        add(jtf, BorderLayout.SOUTH);
        tree.addMouseListener(new MouseAdapter() {
          public void mouseClicked(MouseEvent me) {
            TreePath tp = tree.getPathForLocation(me.getX(), me.getY());
            if (tp != null)
              jtf.setText(tp.toString());
            else
              jtf.setText("");
      public JPanel JTreeText() {
             JPanel jp= new JPanel();
             JPanel jpanel= new JPanel();
             setPreferredSize(new Dimension(400,350));
             jp.setPreferredSize(new Dimension(400,300));
             JScrollPane jsp = new JScrollPane(jp);
             jsp.setPreferredSize(new Dimension(400,300));
             jpanel.add(jsp, BorderLayout.CENTER);
             jtf = new JTextField("", 20);
             fc = new JFileChooser();
             openButton = new JButton("Open a File...",new ImageIcon("images/hui.gif"));
             openButton.addActionListener(this);
             JPanel buttonPanel = new JPanel(); //use FlowLayout
             buttonPanel.add(openButton);
             //jp.add(buttonPanel, BorderLayout.PAGE_START);
             jp.add(buttonPanel, BorderLayout.NORTH);
             jp.add(jtf, BorderLayout.CENTER);
             return jpanel;
      public static void main(String[] args) {
        JFrame frame = new JFrame();
        frame.getContentPane().add(new JTreeSplitChooseDemo(), new BorderLayout().WEST);
        frame.getContentPane().add(new JTreeSplitChooseDemo().JTreeText(), new BorderLayout().CENTER);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(800, 350);
        frame.setVisible(true);
    @Override
    public void actionPerformed(ActionEvent e) {
         //Handle open button action.
        if (e.getSource() == openButton) {
          int returnVal = fc.showOpenDialog(JTreeSplitChooseDemo.this);
          if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = fc.getSelectedFile();
             jtf.setText(file.getName());
          } else {
             jtf.add("Open command cancelled by user.", null);
    }For example, If i choose file : C:\temp\ftp\TestMyFile.txt
    after I press open button, then choose it, then, the file name TestMyFile.txt will be displayed in the textFiled.
    My problem is that I hope to choose any node in the JTree on the left Panel, then when I choose it, this JNode I selected will be displayed its name in the TextField.
    Not file, I need choose JNode,
    ie, B1 under B node, or A1 under A node, then B1 will be displayed in jtf.
    How to do this one??
    Can Guru throw some light??
    Thanks
    sunny

    Thanks, camickr.
    My fault not to explain detail.
    Actually I mean that I will use a dialog box(very much look like a file choose) that is something like a file chooser then I can browse over JTree first for any node then I can choose or select a node in this JTree, after select this node, its name is populated into text field. My one is I will use a JTree browser (something like that) to get a tree node.
    ie, this showOpenDialog will browse over JTree, not File system.
    I did not want to click on the node then this node name is populated into textField.
    the sample (http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html) shows that when I select a node, then its name was populated to a destination.

Maybe you are looking for

  • I want to cancel Creative Cloud ... but can't get through to the gatekeepers

    Like so many others I've been tearing my hair out in an effort to cancel Creative Cloud, which has never worked on my computer. I tried the 1-800 number, but after costing me a lot of money (due to long waits and a per-minute charge on my phone plan)

  • I don't have IMAQ vision, where can I get some super basic easy VI's for IMAQ?

    Hello, I don't have IMAQ vision, where can I get some super basic easy VI's to get images from my IMAQ PCI-1424 board, without Vision?? is there some kind of tutorial that will help me get started from the ground up in designing VI's? Also I am tryin

  • Including location file in Attachment of IP_MESSAGE_TYPE to B2B

    Dear Reader, I am using SOA suite 10.1.3.4. and B2B 10g configured in Suse. I have made a BPEL proces that enqueues messages using an AQ adapter to the B2B database. For this I need to fill in the IP_MESSAGE_TYPE (payload header) that is required by

  • Customer Aging / Differe

    Dear Gurus, At sales order level my sold to party is different compare to rest of the mandatory partner function. Invoice post against payer. which is different as compare to sold to party. is there standard way so that system can also check the agin

  • Searching for IDT options

    Hello All, Under Information Design Tool, I am looking for the Advanced Join Properties which is available under Universe Design Tool. Advanced --> My question is simple, where can I find the option in Information Design Tool (SAP BI 4.1 SP2) Best re