How to choice line type in JTree

hi
the line in my JTree is dashed, could you help me to change it to real line?
thx so much

I do not think so, sir.
Under Windows LAF, I can find solid line type JTree, but I really do not know why line type in My JTree is dashed;
Please look at the following: (this is solid version with window Look and Feel)
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.UIManager;
import javax.swing.JTree;
import javax.swing.tree.*;
import java.awt.GridLayout;
public class TreeDemo extends JPanel{
    private JTree tree;
    private static boolean DEBUG = false;
    //Optionally play with line styles.  Possible values are
    //"Angled" (the default), "Horizontal", and "None".
    private static boolean playWithLineStyle = false;
    private static String lineStyle = "Horizontal";
    //Optionally set the look and feel.
    private static boolean useSystemLookAndFeel = false;
    public TreeDemo() {
        super(new GridLayout(1,0));      
        //Create a tree that allows one selection at a time.
        tree = new JTree();
        tree.getSelectionModel().setSelectionMode
                (TreeSelectionModel.SINGLE_TREE_SELECTION);
        //Create the scroll pane and add the tree to it.
        JScrollPane treeView = new JScrollPane(tree);     
          add(treeView);
     * Create the GUI and show it.  For thread safety,
     * this method should be invoked from the
     * event-dispatching thread.
    private static void createAndShowGUI() {
         try{
               UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
          }catch(Exception e){
        if (useSystemLookAndFeel) {
            try {
                UIManager.setLookAndFeel(
                    UIManager.getSystemLookAndFeelClassName());
            } catch (Exception e) {
                System.err.println("Couldn't use system look and feel.");
        //Make sure we have nice window decorations.
        JFrame.setDefaultLookAndFeelDecorated(true);
        //Create and set up the window.
        JFrame frame = new JFrame("TreeDemo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //Create and set up the content pane.
        TreeDemo newContentPane = new TreeDemo();
        newContentPane.setOpaque(true); //content panes must be opaque
        frame.setContentPane(newContentPane);
        //Display the window.
        frame.pack();
        frame.setVisible(true);
    public static void main(String[] args) {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
}

Similar Messages

  • ALV Graphs: How to set line type graph as default graph

    Hi All,
    I need to develop a line graph. The fields on the X-axis will change dynamically. Some times they may be 10 field and some times they may be more than 100 fields. I tried with Function Module GFW_PRES_SHOW_MULT. But I can only display maximum 32 fields. Can anyone tell me exact program which helps me to full fill my requirement. It will be a great help if you could told how do display line type graph as default graph in ALV.  In REUSE_ALV_GRID_DISPLAY there is a Exporting parameter MT_CHART_TYPES but this help you only to enter description for X-axis and Y-axis.
    Many thanks in advance.

    I would call GRAPH_MATRIX_2D with options depending on representation you wish
    look at the program GRBUSG_1 to see how to use it
    there you have some options to display bar chart, but you could use other values (complete list of options is available in documentation of function module GRAPH_MATRIX_2D - click on parameter OPTS in help display to see full explanation)
    exemple:
    P2TYPE = LN to display lines

  • How to change line type on EAM Purchase Requisitions

    When an EAM Work Order is released, we get Purchase Requisitions with the Line Type as the Purchasing Options default. This can be changed on the req but there is no option to select the req line type on the EAM Work Order page.
    There's a Line Type field on the EAM Work Order page but it's different from the Requisition Line Type.
    Just wondering what are our options to give users the ability to select req line type from EAM Work Order page. We know personalization is an option but we'd need to add a brand new field and even if we do, we are unsure that ReqImport will actually use this new field.
    Workflow extensions could also be a solution and was hoping that someone out there would have some tips and tricks to share.
    Regards,
    Sanjib

    I think the only way is to:
    1) read the address data from Matrix 178 and keep the data in your Add-On
    2) delete the original address (activate the menu item (ID = 1293) or send Ctrl-K via Application.SendKeys)
    3) "click" on "Define new"
    4) and enter the data you have read in 1) into the cells of Matrix 178 again...
    HTH

  • How to get the line type of a table type

    Hi,
      i want to indetify the line type of a table type dynamically in my program. how to do?
    For example:
    data: lv_ttype type type ROLLNAME value 'PRXCTRLTAB'.
    how to identify line type of lv_ttype in the program.
    Thanks,
    johnney.

    Hello Johnney,
    try like this...
    types: begin of ty_itab,
                matnr like mara-matnr,
                werks like marc-werks,
                maktx like makt-maktx,
              end of g_t_itab.
    data: g_t_itab type table of ty_itab.
    data: <b>wa_itab like line of g_t_itab.</b> " This is line type... so called work area.
    Reward If Helpful.
    Regards
    Sasidhar Reddy Matli.

  • Using of table type- - line type fields in proxy

    how to use line type fields in proxy for variable assingment, sample code will be good.

    HI,
    I need to use Type Standard table of in second report, as i am submitting to the standard report..so i cant modify...
    i want to export from first report as standard type table .....
    vikrant's code is working but i still need this to fix the problem....
    Vasuki: code is exactly you pasted....
    REPORT  ZTEST_FIRST.
    data: itab1 TYPE TABLE OF tdt_docflow,
          wa_itab like LINE OF itab1.
    wa_itab-docnum = '12345'.
    APPEND wa_itab to itab1.
    export itab1 to MEMORY ID 'ABCDE'.
    submit ztest_second and return.
    BREAK-POINT.
    I am expecting like
    REPORT  ZTEST_FIRST.
    data: itab1 TYPE STANDARD TABLE OF tdt_docflow,
          wa_itab type tds_docflow.
    wa_itab-docnum = '12345'.
    APPEND wa_itab to itab1.  " this append need to change
    export itab1 to MEMORY ID 'ABCDE'.
    submit ztest_second and return.
    BREAK-POINT.
    Giri

  • How to create a line type in data dictionary

    How to create a line type in data dictionary?Please explain step by step?
    Thanks & Regads,
    Sairam

    Hi,
    the details abbout the line type.
    The line type of a table type can be defined by:
    o Specification of a type that already exists (data element,
    structure, table type, table, view) whose properties are then copie
    as properties of the defined table line.
    o Direct type input, where data type, number of positions, and, if
    required, decimal places, are entered directly.
    o Specification of a reference type.
    and SE11 and click on datatype and click on table type and enter the line type.
    Thanks
    Shiva

  • How to set field type choice using csom (c#)

    I have a field type: Choice (menu to choose from) which is not multichoice. How do I set a value?
    I have found code for multiple choice but it doesn't seem to work for single choice.

    Hi,
    The following code snippet for your reference:
    newListItem["ChoiceFieldName"] = "ChoiceValue";
    newListItem.Update();
    clientContext.Load(newListItem);
    clientContext.ExecuteQuery();
    If you are assigning a Value which is not in the Choice Column, You need to create a choice value then assign it to the item.
    More information is here:
    http://sharepoint.stackexchange.com/questions/124999/how-to-set-field-type-choice-using-csom-c
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Urgent : How to modify the line type and table type

    I am working on ALV Grid Control, i need to know how to modify the line type values to table type.
                 ls_celltab-fieldname = 'ZSAVINGS '.
                 ls_celltab-style = l_mode.
            INSERT ls_celltab INTO TABLE pt_celltab.
    Here ls_celltab is line type and pt_celltab is table type.
    Please give me the suggestion ASAP.
    C.Bharath Kumar

    Hi,
    Here is the example
    DATA: BEGIN OF LINE,
            LAND(3)  TYPE C,
            NAME(10) TYPE C,
            AGE      TYPE I,
            WEIGHT   TYPE P DECIMALS 2,
          END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE
              WITH NON-UNIQUE KEY LAND NAME AGE WEIGHT.
    LINE-LAND = 'G'.   LINE-NAME   = 'Hans'.
    LINE-AGE  = 20.    LINE-WEIGHT = '80.00'.
    INSERT LINE INTO TABLE ITAB.
    LINE-LAND = 'USA'. LINE-NAME   = 'Nancy'.
    LINE-AGE  = 35.    LINE-WEIGHT = '45.00'.
    INSERT LINE INTO TABLE ITAB.
    Regards
    Sudheer

  • How do I change legends in line charts when you change line type

    I have created a line chart with two lines. I only have a black and white printer. If I change the two lines to black, the legends change to match. To distinquish the two lines I change the line type making one dots and the other dashes. The lines change but the lengends don't. This makes the graph useless.
    Any suggestions on how to get the lines in the legends to change to match the lines in the graph?
    Thanks for any help.
    Paul

    I could not get the line legends to differ either. You can add a marker to only 1 of the plots though:
    Regards,

  • How to retrieve sales order line type

    Hello,
    Maybe I found a workaround for the previous issue but I faced a new problem (matrix of form 139).
    I tried to read the matrix column 257 but it's always blank even if the row is a text row (of type = T).
    I need to exclude this type of line in a loop.
    Is there a way to do this ?
    Please help me.
    Best regards.
    Andrea

    Hi Andrea,
    Line Status field is not linked to the Type of row. Line status is O or C - Open or Closed. If all lines are closed then the document will close.
    Try writing 2 queries like this
    select * from RDR1 where DocEntry = '4'
    select * from RDR10 where DocEntry = '4'
    where 4 will be the doc entry of the Sales order which contains Sub types. In the Table RDR10, you'll find LineType which contains the types.
    Can you tell me what do you need the line Type for so that i can give you a better solution?

  • Graphs- Line Type, How to change line colors

    Hi,
           Iam developing graph line type with 2 seriese by default it show two colors  i.e Blue and Green . But i need red color for one of series. I checked in edit customization also i didnt find any option to change color of line . Pls helpme...
    Thanks,
    Krishna

    ]Hi,
    I think in global settings there is a option.
    Refer this link
    [customizing graphs|https://docs.google.com/viewer?a=v&q=cache:R1LWS-t_9xcj:www.sdn.sap.com/irj/scn/index%3frid%3d/library/uuid/c0bad079-1779-2c10-a8b1-ba76854ea6d1%26overridelayout%3dtrue+&hl=en&gl=uk&pid=bl&srcid=ADGEEShZuzUOlbxrVLkMLz511amV8K8seqKtGnfF-IXzNr_BRxDiNuT1OBIa0qCjD4Juf_RXul0iXYZJJpFM7foVU3oShbhRnQcFzCT637fSf7v5Qt2jJkHAZkFnfRSFOQZsoKLuatil&sig=AHIEtbRRDGjx1OANmLwZks8AmQfUMpGISQ
    Karthik.R

  • How to dynamically add Nodes to JTree?

    How to add nodes to a Jtree by getting the information into a specific file
    For example, in JList:
    DefaultListModel workgroups;
    workgroups = new DefaultListModel();
    List<String> workgroupsList = new ArrayList<String>();
    workgroupsList = ParserUtils.getWorkgroupList(ParserUtils.getConfigPath() + "\\.workgroup.properties");
    if (!workgroupsList.isEmpty()){
         for (String workgroup : workgroupsList){
              workgroups.addElement(workgroup.toString().trim());
    workgroupList = new JList(workgroups); //adds the list workgroupsThe output of this will be a JList displaying the list of workgroups per line. The list could be found in a file name "workgroup.properties"
    Question is, is it possible to adapt this same method in JTree. The information per line will serve as one node in the tree. For example, I have 3 workgroups in the list, there will also be 3 nodes to be found in the tree.
    Any suggestions?
    THanks.

    There's a huge JTree example in the Swing tutorial. It's a bit of a beast to use.

  • Mapping Line type Data to table data

    Hi,
    I am trying to refer to a data element present in the line type of a table type which belongs to an import parameter of a smartform. How will i access the data element to use in the where clause of a select statement.
    For Eg:
    Import Parameter name: PARTNER_H
    TYPE: CRMT_OUTPUT_PARTNER_H_COMT  (table type)
    The line type attached to this table type is CRMT_OUTPUT_PARTNER_H_COM.
    This line type is the structure that contains the data element that i need to use. the details are as below:
    Component: RELATION_PARTNER
    Component type: BU_PARTNER_GUID
    I have written a select statement as below:
    SELECT SINGLE * from BUT000 into I_FS_BUT000 where
      PARTNER_GUID = PARTNER_H-RELATION_H.
    I have given the input parameter as  PARTNER_H.
    It throws me an error that "PARTNER_H" is a table without a header line and therefore has no component called "RELATION_H".
    Is this the correct way to access the data element?Please help.

    Hi Neena,
                   Since PARTNER_H is an internal table it may have multiple values. If you want only a single entry from BUT000, you ll have to determine which entry from PARTNER_H you need in select query.
    If it is always going to have only a single value then , this will work :
    data: wa_partner_h type line of CRMT_OUTPUT_PARTNER_H_COMT.
    Read table partner_h into wa_partner_h index 1.
    if sy-subrc is initial.
    SELECT SINGLE * from BUT000 into I_FS_BUT000 where
    PARTNER_GUID = WA_PARTNER_H-RELATION_H.
    endif.
    Regards,
    Arun

  • GL account with line items in line type 'S' document split?

    Hi Experts,
    We found in PCP0 there are payroll documents which has GL account with with line items in line type 'S' document split. Unlike other line items with line type 'blank' these line items cannot be opened and display the wage type details. How can we know from which wage type these line items were created?
    Regards,
    Allan

    These line items are caused by company transfer and they are cleared by themselves between companies.

  • How to decrease line width in table in smartforms

    hi i want to decrease line widht in tabel in smartforms.
    how can i do.
    thanks.

    Hi
    The width of the Line Type in a table is decided by table width itself. For example 20cm is the width of the table,then you can divide the table width into number of columns you want. If you want only 2 columns then,
    next to the line type..one column width would be 10 and the other would be 10...so If you want to decrease the width of a column in the line type..then you would have to adjust that in the other one.
    For example, If 10 and 10 cm each is what you have in your line type, then in the first column you can reduce the width to 5 cm and then increase the other column width to 15cm, in that way the total width of the line type will be equal to that of the table width.
    Also, it is not necessary that the line type width should be equal to table width. It can be less also.
    You can adjust the width at details tab..here you will have the table line type details like this:
    Line Type                                      1.                         2.
    LTYPE1%                                   10.00cm               10.00 cm "here you can reduce the table line width.
    Hope I am clear.
    Regards,
    Vishwa.

Maybe you are looking for

  • Reg : Print Issue in ALV Report

    Hi Experts,                  I have created an ALV Report for USER Requirement and it is working fine. While taking printout the SORTED Field is not working, it gets repeated in the Print... How to rectify..?

  • File transfer from UNIX server to Windows server path

    Hello Experts, (Gud Even Gud Aft & Gud Mor) Is there a way to transfer file from UNIX server(Oracle database), to Windows server? All I know if Windows path. I am able to read the file as it is on server, however it does not recognize Windows directo

  • To make firefox handle mms protocol here is a technique that works well. [SOLVED for some versions]

    Okay folks. Mozilla is playing their cards very close to their chest with this one, though I can't understand why all the secrecy. <p> '''2012 EDIT''' Since version 7, Firefox appears broken and unable to recognize mms protocol. HOWEVER, if you copy

  • The icons in MacBook are not working

    Hi, The desktop icons in my MacBook are not working and this force me to use FILE --> New finder window to open the Safari etc... How do I make my icons work from desktop. Appreciate your help.  Thanks. Ananth

  • Quality Manager - Clearing Unscored Call recordings

    Probably a very basic question, but unfortunately I'm not yet familiar with this product. Some of our supervisors wish to clear out a backlog of "Unscored" recordings from the list in Quality Management Desktop, so that they can start with a clean sl