Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 292
  • Last Modified:

Changing TextArea UI with PGS Look and feel

I am using PGS look and feel. The Characters in Textfiled and text Are are not displayed properly.
I have changed textfield ui as

class TextFieldLookNFeel extends PgsLookAndFeel
{
      protected void initClassDefaults(UIDefaults table)
      {
            super.initClassDefaults( table );
            //Object[] defaults = { "TextFeildUI", "YourTextFieldUI" } ;
            Object[] defaults = {"TextFieldUI","com.sun.java.swing.plaf.windows.WindowsTextFieldUI"};
            table.putDefaults(defaults);
      }
}

I am using TextFieldLookNFeel  as theme.
Now I want to do the same for TextArea

Thanks
0
sangameshrh
Asked:
sangameshrh
  • 3
  • 2
1 Solution
 
Dejan PažinHead of SW DevelopmentCommented:

How do you set look and feel? I tried your code and characters work fine in both JTextField and JTextArea.
0
 
sangameshrhAuthor Commented:
UIManager.setLookAndFeel(new TextFieldLookNFeel());

It is working fine with JTextField but not JTextArea
0
 
Dejan PažinHead of SW DevelopmentCommented:

I'll need your code to see the problem. It works fine when i try this.

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
ksivananthCommented:
trye this,


            Object[] defaults = {"TextFieldUI","com.sun.java.swing.plaf.windows.WindowsTextFieldUI",
                                             {"TextAreaUI","com.sun.java.swing.plaf.windows.WindowsTextAreaUI"};
            table.putDefaults(defaults);
0
 
Dejan PažinHead of SW DevelopmentCommented:

What you posted doesnt compile. Did you mean:

            Object[] defaults = {"TextFieldUI","com.sun.java.swing.plaf.windows.WindowsTextFieldUI"};
            table.putDefaults(defaults);
            Object[] defaults2 = {"TextAreaUI","com.sun.java.swing.plaf.windows.WindowsTextAreaUI"};
            table.putDefaults(defaults2);

I tried that, and it works. I'll need more of your code.

0
 
ksivananthCommented:
its a typo, it should have been typed as

Object[] defaults = {"TextFieldUI","com.sun.java.swing.plaf.windows.WindowsTextFieldUI",
                                "TextAreaUI","com.sun.java.swing.plaf.windows.WindowsTextAreaUI"};


0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now