Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #2721

Re: JlayeredPane in netbeans

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-out.readnews.com!news-xxxfer.readnews.com!postnews.google.com!b13g2000prf.googlegroups.com!not-for-mail
From mukesh tiwari <mukeshtiwari.iiitm@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: JlayeredPane in netbeans
Date Fri, 1 Apr 2011 23:26:51 -0700 (PDT)
Organization http://groups.google.com
Lines 75
Message-ID <cf1e3a22-c64d-4bba-bc41-585ca16683ff@b13g2000prf.googlegroups.com> (permalink)
References <ec706a53-b845-49dc-a809-b1246dee81ea@o21g2000prh.googlegroups.com> <in5i3l$892$1@dont-email.me>
NNTP-Posting-Host 117.194.231.142
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Trace posting.google.com 1301725673 23707 127.0.0.1 (2 Apr 2011 06:27:53 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Sat, 2 Apr 2011 06:27:53 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info b13g2000prf.googlegroups.com; posting-host=117.194.231.142; posting-account=utVMDgoAAACBclB38JUYjL1LjVN2Gha6
User-Agent G2/1.0
X-HTTP-UserAgent Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.43 Safari/532.5,gzip(gfe)
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2721

Show key headers only | View raw


On Apr 2, 3:03 am, markspace <-@.> wrote:
> On 4/1/2011 12:23 PM, mukesh tiwari wrote:
>
>
>
>
>
> > Hello all, I am trying to put two components Jeditorpane and Jtextarea
> > in Jlayeredpane. I am using Netbeans. I added jeditorpane and
> > jtextarea in jlayeredpane and two buttons. When i click on button1
> > then it should show message "Hello world doing nice".
>
> >   private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
> > {
> >      // TODO add your handling code here:
> >      jTextArea1.setText("");
> >      jTextArea1.setOpaque(true);
> >      jLayeredPane1.moveToFront(jEditorPane1);
> >      jEditorPane1.setText("Hello world doing nice");
> > }
> > and when click on button2 then it should show message "Hello world not
> > doing good".
>
> >   private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)
> > {
> >      // TODO add your handling code here:
> >      jEditorPane1.setText("");
> >      jEditorPane1.setOpaque(true);
> >      jLayeredPane1.moveToFront(jTextArea1);
> >      jTextArea1.setText("Hello world not doing good");
> > }
>
> I simplified these methods to remove unnecessary calls.  The result is
> better and the text now displays.  However the formatting is still a bit
> odd, it looks like some of the text is offset slightly from the origin.
>   I'm not sure why that is.
>
> Here are the improved event handlers.
>
> private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
>      // TODO add your handling code here:
> //    jTextArea1.setText("");
> //    jTextArea1.setOpaque(true);
> //    jLayeredPane1.moveToFront(jEditorPane1);
>      jEditorPane1.setText("Hello world doing nice");
>
> }
>
> private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
>      // TODO add your handling code here:
> //    jEditorPane1.setText("");
> //    jEditorPane1.setOpaque(true);
> //    jLayeredPane1.moveToFront(jTextArea1);
>      jTextArea1.setText("Hello world not doing good");
>
>
>
> }

Hi markspace
Thank you for your reply but this is not fulfilling the purpose
because texts are deformed in second case. I don't know if i
understand the JlayeredPane fully but what  in my mind is , i added
two components [ jeditorpane and jtextarea ] in jLayeredpane in same
Default_Layer and use the function moveTofront and moveToback to move
these components in same layer.When jeditorpane will be in front
position then it will hide all the contents of jtextarea and vice-
versa. Its like dynamically changing the components position in layer
but i don't think this is happening. Thanks again for your valuable
insights.
Regards
Mukesh Tiwari

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

JlayeredPane in netbeans mukesh tiwari <mukeshtiwari.iiitm@gmail.com> - 2011-04-01 12:23 -0700
  Re: JlayeredPane in netbeans markspace <-@.> - 2011-04-01 15:03 -0700
    Re: JlayeredPane in netbeans mukesh tiwari <mukeshtiwari.iiitm@gmail.com> - 2011-04-01 23:26 -0700
      Re: JlayeredPane in netbeans "John B. Matthews" <nospam@nospam.invalid> - 2011-04-02 10:41 -0400

csiph-web