Enable a button using java

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deepthisoft
    New Member
    • Jul 2007
    • 27

    Enable a button using java

    Hi,
    In my screen i have a jtable and a button. At the beginning the button is disabled. When i select a row the Button Will be Enable.
    How can i do this. Please anyone help me for this. This is very helpful for me.
    Regards,
    Deepthi
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by deepthisoft
    Hi,
    In my screen i have a jtable and a button. At the beginning the button is disabled. When i select a row the Button Will be Enable.
    How can i do this. Please anyone help me for this. This is very helpful for me.
    Regards,
    Deepthi
    Extend the JTable class and override the changeSelection () method. Your
    new method should en/disable the button and call the super.changeSel ection()
    implementation. Read the API documentation for details.

    kind regards,

    Jos

    Comment

    • deepthisoft
      New Member
      • Jul 2007
      • 27

      #3
      Hi,
      Thanks for your reply.
      Can you please give some sample codings for changeselection method at the time of row selection.

      Thanks in advance,
      Regards,
      Deepthi.

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by deepthisoft
        Hi,
        Thanks for your reply.
        Can you please give some sample codings for changeselection method at the time of row selection.
        No I won't do that for you; read my previous reply: extend the JTable class and
        override that single method; the body of that method only takes two lines:

        1) en/disable your button
        2) call the super.changeSel ection method to let it do what has to be done.

        kind regards,

        Jos

        Comment

        Working...