Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2011
    Posts
    3
    Rep Power
    0

    Wink Jlabel selection

    Hi how can i change my Jlable variable to make it just selected by cursor, to help user copying the contain easily.

  2. #2
    RichersooN is offline Senior Member
    Join Date
    Jan 2011
    Location
    Rizal Province, Philippiines
    Posts
    167
    Rep Power
    0

    Default

    implements a mouselistener{
    String labelText = label.getText();

    somewhere.setText(labelText);
    }

  3. #3
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,234
    Rep Power
    7

    Default

    JLabels don't support selection. Use a non-editable JTextField.

  4. #4
    Join Date
    Apr 2011
    Posts
    3
    Rep Power
    0

    Default

    Thanks, so can i change the style of the JTextField, in the case to don't show the border ?

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default

    Read the API. Experiment with methods that look like they may be useful.

    Hint: many of the setXxx(...) methods can be passed a null. For example, setLayout(null) removes any existing layout manager.

    db

Similar Threads

  1. Adding a JLabel to a JPanel - jlabel not showing
    By Bongeh in forum New To Java
    Replies: 17
    Last Post: 04-06-2010, 11:02 PM
  2. discontinous selection
    By jogendar in forum Advanced Java
    Replies: 0
    Last Post: 01-15-2010, 06:13 AM
  3. Help in Project Selection?
    By Hardik in forum New To Java
    Replies: 2
    Last Post: 09-03-2009, 05:27 PM
  4. Key selection for SSL/TLS
    By OrangeDog in forum Advanced Java
    Replies: 3
    Last Post: 04-27-2009, 10:38 PM
  5. List Selection
    By Sarinam in forum AWT / Swing
    Replies: 2
    Last Post: 07-14-2008, 06:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •