Results 1 to 12 of 12
  1. #1
    lottalava is offline Member
    Join Date
    Oct 2009
    Posts
    7
    Rep Power
    0

    Default How to hide a control in SWT?

    Hello folks, can anyone hre tell me, how to hide a SWT Control?
    I tried setVisible( ), but the control is still using space in my composite and i want it completely disappear, like object.style.display = "none" in CSS.

  2. #2
    singswt is offline Member
    Join Date
    Oct 2009
    Posts
    6
    Rep Power
    0

    Default

    Hide or destroy?

    Just hiding might still use the container(need a place to hide too right?), just plain thinking.

    I would suggest destroying it.

    You could achieve what I suggest by looping over the the widgets in the container and then locating the one you want to destroy and then doing
    controlObject.dispose();

    Something like:
    Java Code:
    for(Control controlObject : nameOfContainer.getChildren()){
      if(controlObject == nameOfYourControl){
           controlObject.dispose();
       }
    }
    Cheers
    -singswt

  3. #3
    lottalava is offline Member
    Join Date
    Oct 2009
    Posts
    7
    Rep Power
    0

    Default

    Ops, destroy the control is not a good solution, cause the user could desire sometime to it show up, turn it invisble is perfect, but as i said even invisible the control consumes space in the container.
    And that's the problem, would be perfect to turn the control invisible and it completely vanish from the user's sign.

  4. #4
    singswt is offline Member
    Join Date
    Oct 2009
    Posts
    6
    Rep Power
    0

    Default

    Why can't you new out the control when the user wants to see it? and fill up the properties of the control again, so basically having the code for the control in one place and using a method call to re populate the control could work.

  5. #5
    lottalava is offline Member
    Join Date
    Oct 2009
    Posts
    7
    Rep Power
    0

    Default

    Cause is simpler to just hide the control than destroy and build all the layout again to show it.

  6. #6
    singswt is offline Member
    Join Date
    Oct 2009
    Posts
    6
    Rep Power
    0

    Default

    please do publish about how you succeeded when you succeed.
    thanks,

  7. #7
    vivek123 is offline Member
    Join Date
    Nov 2009
    Posts
    6
    Rep Power
    0

    Default

    Can any body how to open matlab with java swt

  8. #8
    vivek123 is offline Member
    Join Date
    Nov 2009
    Posts
    6
    Rep Power
    0

    Default

    can any body know how to open matlab with activex controll in java swt?

  9. #9
    vivek123 is offline Member
    Join Date
    Nov 2009
    Posts
    6
    Rep Power
    0

    Default

    can any body know how to open matlab with activex controll in java swt?

  10. #10
    singswt is offline Member
    Join Date
    Oct 2009
    Posts
    6
    Rep Power
    0

    Default

    what you mean by open matlab ? can you explain?

  11. #11
    rainbowsoft is offline Member
    Join Date
    May 2010
    Posts
    5
    Rep Power
    0

    Default

    You may try
    .setVisible();
    shell.layout();

  12. #12
    Maja is offline Member
    Join Date
    Oct 2010
    Posts
    2
    Rep Power
    0

    Default

    If you're using GridLayout, you can use the exclude property on control's GridData.
    Here's a link to an example snippet:
    Exclude a widget from a GridLayout : Layout**SWT JFace Eclipse**Java

Similar Threads

  1. How to Hide cursor
    By priya in forum Java Software
    Replies: 1
    Last Post: 12-09-2010, 10:39 PM
  2. hide one frame under another
    By marodia in forum AWT / Swing
    Replies: 7
    Last Post: 08-25-2009, 02:23 PM
  3. [SOLVED] how to hide jframes
    By yonghan in forum AWT / Swing
    Replies: 6
    Last Post: 08-10-2009, 05:08 AM
  4. How to hide Download Link
    By tarzan1234 in forum JavaServer Pages (JSP) and JSTL
    Replies: 8
    Last Post: 02-05-2009, 03:49 PM
  5. control app width based on certain control
    By thebillybobjr in forum SWT / JFace
    Replies: 0
    Last Post: 05-15-2008, 05:52 PM

Posting Permissions

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