×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    8

    Disable Title Dialog in LWUIT

    Hi All Developer Nokia,

    I get problem in dialog LWUIT,
    I can't remove title component in Dialog.

    I've already used this code :

    getTitleArea().setVisible(false);

    But not work




    Any solution for this ?
    Thanks For Help
    Last edited by renzatsu1; 2013-09-02 at 05:24.

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Disable Title Dialog in LWUIT

    may be you should think of making an custome dialog all together or using a entire view itself instead of dialogs !!, i have seen these problems and the method you have mentioned will not work !!

  3. #3
    Registered User
    Join Date
    Mar 2013
    Posts
    8

    Re: Disable Title Dialog in LWUIT

    Quote Originally Posted by gaba88 View Post
    may be you should think of making an custome dialog all together or using a entire view itself instead of dialogs !!, i have seen these problems and the method you have mentioned will not work !!
    Thanks for reply Sir gaba88, I've already made my costume dialog , but I can't remove title component (gray area at picture)
    Do you have any solution?

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Disable Title Dialog in LWUIT

    Quote Originally Posted by renzatsu1 View Post
    Thanks for reply Sir gaba88, I've already made my costume dialog , but I can't remove title component (gray area at picture)
    Do you have any solution?
    It looks that you might be extending LWUIT dialog for doing it - try making your own Custom dialog by extending the LWUIT component class and make like your own custom component.

    Refer to this link - http://docs.oracle.com/javame/dev-to...chapter15.html
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  5. #5
    Registered User
    Join Date
    Dec 2012
    Location
    India
    Posts
    264

    Re: Disable Title Dialog in LWUIT

    You could try using a Glass Pane.A glass pane is basically drawn on top of a form.It could be used as a replacement for Dialogs.

    More info here :

    http://lwuit.blogspot.in/2009/03/val...glasspane.html

  6. #6
    Registered User
    Join Date
    Mar 2013
    Posts
    8

    Re: Disable Title Dialog in LWUIT

    Quote Originally Posted by im2amit View Post
    It looks that you might be extending LWUIT dialog for doing it - try making your own Custom dialog by extending the LWUIT component class and make like your own custom component.

    Refer to this link - http://docs.oracle.com/javame/dev-to...chapter15.html
    Thanks for reply im2amit,
    I've already made my own Custom dialog by extending the LWUIT component class

    This is my code
    public class DefaultMessageDialog extends Dialog {
    QChatButton yes = new QChatButton("", MasterColor.BTN_YES,MasterColor.BTN_YES, "");
    public DefaultMessageDialog(String message) {
    setLayout(new BorderLayout());

    getContentPane().getStyle().setBorder(
    new RoundedBorderLinearGradient(MasterColor.WHITE,
    MasterColor.WHITE, true, MasterColor.WHITE, 10, 10));
    getContentPane().getStyle().setBgColor(MasterColor.WHITE);
    getTitleComponent().getStyle().setBgColor(MasterColor.WHITE);
    getTitleArea().setVisible(false);

    QChatTextArea textArea = new QChatTextArea(message, 1, 3);
    textArea.setEnabled(false);

    StyleMaster.clearAllMarginAndPadding(textArea.getDisabledStyle());
    yes.setMargin(LEFT, 50);
    addComponent(BorderLayout.CENTER,textArea);
    addComponent(BorderLayout.SOUTH,yes);
    show(90, 90, 10, 10, false);
    }
    }
    But still have title component, same as my picture before..

  7. #7
    Registered User
    Join Date
    Mar 2013
    Posts
    8

    Re: Disable Title Dialog in LWUIT

    Quote Originally Posted by arunkam View Post
    You could try using a Glass Pane.A glass pane is basically drawn on top of a form.It could be used as a replacement for Dialogs.

    More info here :

    http://lwuit.blogspot.in/2009/03/val...glasspane.html
    Hi Sir Arunkam,
    Thanks for reply..
    I've tried glasspane, But still error ,
    How can I get the value of this constant "VALIDATION_PROP" ?

    And Where should I put this code ?

  8. #8
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Disable Title Dialog in LWUIT

    public class DefaultMessageDialog extends Dialog {
    QChatButton yes = new QChatButton("", MasterColor.BTN_YES,MasterColor.BTN_YES, "");
    public DefaultMessageDialog(String message) {
    setLayout(new BorderLayout());
    I can see in your code that you are extending Dialog { }
    don't do it -- extend Component { }
    Refer to http://docs.oracle.com/javame/dev-to...chapter15.html
    While making this new component you don't write the code to paint the title and you will not have it.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  9. #9
    Registered User
    Join Date
    Dec 2012
    Location
    India
    Posts
    264

    Re: Disable Title Dialog in LWUIT

    Quote Originally Posted by im2amit View Post
    I can see in your code that you are extending Dialog { }
    don't do it -- extend Component { }
    Refer to http://docs.oracle.com/javame/dev-to...chapter15.html
    While making this new component you don't write the code to paint the title and you will not have it.
    Hi

    I am not sure about this, but if a custom component is made by extending Component, it can be added to a form without any problem.But, how can it be displayed like a dialog ? I am not sure if it is possible

    Quote Originally Posted by renzatsu1 View Post
    Hi Sir Arunkam,
    Thanks for reply..
    I've tried glasspane, But still error ,
    How can I get the value of this constant "VALIDATION_PROP" ?

    And Where should I put this code ?
    I am not sure where I can get the full source code for that.There is an example for faded scroll Bar here

    http://lwuit.blogspot.in/2008/08/pim...glasspane.html

    See if it helps.

    I am also attaching a small piece of code that might help you get started.
    Code:
     Form f = new Form();
                
            Painter p1 = new Painter()
            {
    
                public void paint(Graphics grphcs, Rectangle rctngl) 
                {
                    grphcs.setColor(0x234455);
                    grphcs.fillRect(20,20, 200,200);
                }
            
            };
            
            Painter p2 = new Painter()
            {
    
                public void paint(Graphics grphcs, Rectangle rctngl) 
                {
                    grphcs.setColor(0xffffff);
                    grphcs.drawString("My Custom Dialog Text",30, 20);
                }
            
            };
            
            PainterChain pc = new PainterChain(new Painter[]{p1,p2});
            f.setGlassPane(pc);
            f.show();
    Do note IF your dialog is gonna be simple, this is fine.However, if you are planning to do extensive stuffs on the dialog, then I wouldn't recommend this approach as it might become unnecessarily complicated. In such situation I would suggest u to use a custom dialog itself.

    I also believe that this Title, could be a possible theming issue.If you are using LWUIT for S40, try editing the theme file(s) which is present along with the JAR.It may help.

  10. #10
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,073

    Re: Disable Title Dialog in LWUIT

    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

Similar Threads

  1. S40 LWUIT header title color
    By Javier Muñoz in forum Mobile Java UI and User Experience
    Replies: 5
    Last Post: 2013-08-13, 08:04
  2. Replies: 1
    Last Post: 2011-03-19, 14:22
  3. How To disable Icon on title bar
    By varunghatge in forum Symbian C++
    Replies: 3
    Last Post: 2008-08-26, 09:38
  4. Disable title bar on Nokia 7650...
    By Pacess in forum Mobile Java General
    Replies: 1
    Last Post: 2002-06-24, 06:48
  5. Disable title bar of Nokia 7650...
    By Pacess in forum Mobile Java General
    Replies: 1
    Last Post: 2002-06-24, 06:47

Posting Permissions

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