Use of the method 'getSupportWindowDecorations()'.

Hi,
my application uses a couple of look and feels.
I noticed that the LookAndFeel class has a method called getSupportWindowDecorations(). I want to use this method.
Now the problem is that I cannot get the LookAndFeel object for my look and feels.
I can get all descriptions and classes of my look and feels by executing UIManger.getInstalledLookAndFeels(), but the returned object hereby is a <code>[UIManager.LookAndFeelInfo|http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/UIManager.LookAndFeelInfo.html|class in javax.swing][]. </code>This has a couple of methods to return the name and the class, but all in String format.
How can get the LookAndFeel object for my look and feels so I can use the getSupportWindowDecorations() method?

I want to get the LookAndFeel of a look and feel which is not currently being used.Now you say so.import javax.swing.LookAndFeel;
import javax.swing.UIManager;
public class TestLookAndFeel {
   public static void main(String[] args) {
      UIManager.LookAndFeelInfo[] infos = UIManager.getInstalledLookAndFeels();
      for (UIManager.LookAndFeelInfo info : infos) {
         try {
            String lafName = info.getClassName();
            Class lafClass = Class.forName(lafName);
            LookAndFeel laf = (LookAndFeel) lafClass.newInstance();
            boolean supports = laf.getSupportsWindowDecorations();
            System.out.println(lafName + " : " + supports);
         } catch (InstantiationException ex) {
            ex.printStackTrace();
         } catch (IllegalAccessException ex) {
            ex.printStackTrace();
         } catch (ClassNotFoundException ex) {
            ex.printStackTrace();
}There may be a better way of doing this.
db

Similar Messages

  • NullPointerException caused by the use of the addDoubleField method

    I develop most of my programs in BreezySwing GUI because I like the simplicity of it compared to AWT. I recently bought a new computer that I wanted to make Java equipped; just like my other two computers. I will get back to that later.
    Before I got a new computer, I made all of my programs on the first computer successfully. One of my most significant ones is a multiple conversion program developed in BreezySwing. After I made it, I wanted to make it runnable on my other computer. Using the BreezySwing jar file, the application's class file, an installed JDK, and a batch file, I now know how to make my programs work on new computers.
    Things changed when I tried to put my program on my newest computer. I moved all the necessary files (except the JDK and BreezySwing; which I downloaded again) from the original computer to my newest one. The first two computers had JDK version 7 while the newest one got JDK version 14. I made all the necessary changes to the batch file for the program (such as changing the classpath for the JDK and the class directory). However, upon running this program, Java throws a NullPointerException. This exception does not occur on either of my two other computers.
    Right away, I was determined to find the cause. I have no idea why the exception occurs, but I do know what part of the code causes the exception. By commenting out parts of a test program, I managed to find out that the use of the addDoubleField method causes the exception because it is thrown when not commented out, but it is not thrown when commented out. Here is the code for the test program:
    application: DFTest.class
    import javax.swing.*;
    import BreezySwing.*;
    class DFTest extends GBFrame {
    JTextField txtFld = addTextField("abcdefg",1,1,1,1);
    DoubleField valueFld = addDoubleField(0.0 ,2,1,1,1); /*this line causes the NullPointerException*/
    static public void main(String[] args){
    DFTest obj = new DFTest();
    obj.setSize(300,100);
    obj.setVisible(true);
    }Both my conversion program and this program use the addDoubleField method. I also tested the BreezySwing variable type DoubleField by seperating it from addDoubleField with a constructor. Java did not throw an exception for the DoubleField variable type.
    What do I need to do to get my programs working again?

    I will give one last detailed synopsis of the problem that I am having. I will do my best to include every detail and make the explanation as useful as possible.
    About a year ago I became interested in Java programming. I was learning it at school but I wanted to continue with it on my own as well. The first time I installed Java was on my first computer. I will call this computer Computer A. The first thing I did was download the JDK that was available at the time. It ended up being jdk1.6.0_07. Then I downloaded JCreator IDE because it was the same IDE that I was familiar with in the classroom. The classroom textbook was The Fundamentals of Java, by Lambert and Osborne. This textbook uses the add-on package BreezySwing which is available from their website. I downloaded whatever version or update that was available at the time. Computer A still has that same download.
    In the classroom I became very familar with BreezySwing to the point where I could use all the methods for it comfortably. During the school year, I ended up using about five different computers. There were no problems with them as far as odd errors go. Every time there was an error, it was clearly the fault of the programmer and easily fixable.
    Back to Computer A: Since almost all of the programs I wanted to write used BreezySwing, it had to be set up properly. After some instructions were given to me from my teacher, I created the PATH environment variable and set it to the location of the BreezySwing documentation; which on Computer A was:
    'C:\Program Files\Java\jdk1.6.0_07\bin'
    Every kind of program that I made on Computer A works perfectly; including my test program mentioned earlier:
    application: DFTest.class
    import javax.swing.*;
    import BreezySwing.*;
    class DFTest extends GBFrame {
    JTextField txtFld = addTextField("abcdefg",1,1,1,1);
    DoubleField valueFld = addDoubleField(0.0 ,2,1,1,1);
    static public void main(String[] args){
    DFTest obj = new DFTest();
    obj.setSize(300,100);
    obj.setVisible(true);
    }By now I was getting good at making programs. Some of them I found very useful, so I wanted to make them into some type of executable file. I became familiar with all of them including .jar and .exe. However, the only one that worked for me was the batch file. I also liked its simplicity. I quickly became good at using them to execute Java bytecode.
    The next thing I wanted to do was put the useful programs I had made on a computer that was in the other room. This computer will be called Computer B. Computer B is much older than Computer A, but still a Windows.
    I knew this computer first needed Java installed on it, so I returned to the Sun download site. This time, the newest Java JDK download was jdk1.6.0_13. I also downloaded jre6 and NetBeans IDE to see if I liked it better than JCreator and to have the option to develop Java on Computer B. Next, I had to download BreezySwing again to Computer B.
    A very odd thing occurred next:
    Upon trying to extract the files of BreezySwing to the proper directory 'C:\Program Files\Java\jdk1.6.0_13\bin', a message came saying that every file in BreezySwing required a password. It also said that all the files in the 'bin' folder (of jdk1.6.0_13) were read-only and it would not let any files be placed there. I still do not know why I did not have this issue with Computer A. I did not know what to do for weeks.
    In the end, I had to copy jdk1.6.0_07 from Computer A to Computer B. It already had BreezySwing in it. However, I was unable to set up NetBeans to work with BreezySwing. Part of the problem was that Computer B is too old and slow for such an advanced program like NetBeans. It was at this point that I started using batch and command prompt entirely to execute all the programs I made or used on Computer B.
    Just like I expected, every type of program I made or put on Computer B worked perfectly.
    About a month ago, I got a third computer; Computer C. By now I knew what I wanted in it so again I returned to the Sun download site. This time, I downloaded jdk1.6.0_14 and nothing else. Both Computer A and Computer B also had jre6; but not Computer C because I saw no need for it if I already had the JDK. I also did not bother with IDEs for Computer C; I just used notepad and command prompt to develop programs.
    The first program I put on Computer C was the one that I had made on Computer A. I already got it to work on Computer B, so I used that knowledge to do everything correctly for Computer C. The program would be executed by batch file which would tell the computer it was interacting with:
    1. The directory of the .class file
    2. The directory of the JDKs bin folder
    3. To include BreezySwing.jar in the execution path (needed to recognize all the methods used in the program)
    Everything about the batch files was correct. An error in the batch file would clearly cause an error not Java related; but rather cmd.exe related.
    After placing the .class file into the directory of all my other .class files (and BreezySwing)
    'C:\Documents and Settings\Java Applications\classes+src',
    I changed the information in the batch file to match the jdk update and match the correct class directory. Upon double clicking the batch file, a NullPointerException was thrown.
    Jump ahead to my test program; DFTest.class. After creating several other test programs to try to isolate the cause of the exception, this is what I found:
    When I attempt to execute the following code (after successful compilation):
    application: DFTest.class
    import javax.swing.*;
    import BreezySwing.*;
    class DFTest extends GBFrame {
    JTextField txtFld = addTextField("abcdefg",1,1,1,1);
    DoubleField valueFld = addDoubleField(0.0 ,2,1,1,1);
    static public void main(String[] args){
    DFTest obj = new DFTest();
    obj.setSize(300,100);
    obj.setVisible(true);
    }My message is too long so I will continue...

  • HT5625 if i have multiple apple IDS and i would like to delete all of them except the one I wish to continue using what is the method

    In case I have multiple Apple Ids and I want to delete all of them except one , what is the method to be followed.??
    Or is it that there is no scope for deletion and the Ids are just disabled

    Sorry, Apple ID's cannot be deleted or merged. All you can do is stop using an Apple ID.

  • How use the method hasPermission in weblogic server 6.1

    Hello everybody !
    In my application web ,i restrict access to some ressources (some jsp)
    to some specified groups .
    So,i create permissions in the file web.xml , as indicated in the doc
    6.0 .
    For example only the user : system can access to all the jsp , and the
    others users no .
    Now ,in my code ,I would like to use the method hasPermission in order
    to modify my application according to the differents groups of users .
    But my problem is that i don't know the parameter aclName !
    For the parameter permission I use the syntax "new
    weblogic.security.acl.PermissionImpl(".../x.jsp") .
    For the parameter sep (char),i use : '.' .
    But i don't find the parameter aclName .
    When i was in weblogic 5.1 ,i created permission in the file
    weblogicURL.policy with the syntax : " Permission
    weblogic.security.acl.URLAcl "weblogic.url",".../x.jsp" " and after
    i gave "weblogic.url" as parameter for aclName .
    But in version 6.0, I try web.xml, web ? but nothing is good .
    Is there any person which have an idea or the solution ?
    All the sugestions are welcome !
    Thanks by advance !
    Good bye .

    hi,
    maybe a better approach could be to use roles instead of permissons.
    Your menu.jsp could look like this:
    <%
    if(request.isUserInRole("super-user"))
    %>
    ... code HTML where the button "Creation" is created
    <%
    %>
    You can map the role 'super-user' to an individual principal or a
    user group in weblogic.xml. In that case only users that are in
    the mapped group/principal will see the 'creation' link. So simply
    add user 'system' to a group 'super-user'.
    regards,
    przemek
    Marc Alfonsi schrieb:
    Hi Kirann and everybody!
    Thanks for your message .
    I'm going to explain better than the first time .
    I set up security-constraints in my web.xml .
    For example only "system" can access to the directory Creation and
    all its .jsp , and the others users no .
    Now ,in my code , there is a jsp : menu.jsp which displays some
    possibilities : creation of an employee , visualisation ...with HTML
    code : button "Creation" which call a .jsp of the directory Creation .
    Actually , if a user different of "system" try to click on the button
    "Creation" there is a dialog box of login . The user writes its loggin
    but the access is prohibited ( because security-constraint in web.xml
    ).It's normal but not very well .I would like that a user who don't
    have access to the functionality "Creation" don't see the button
    "Creation" !
    So in menu.jsp , i would like to use the method hasPermission at the
    location of the button "Creation" is created with HTML code :
    <%
    if weblogic.security.acl.Security.hasPermission(.....,new
    weblogic.security.acl.PermissionImpl("/Creation/x.jsp"),'.')
    %>
    code HTML where the button "Creation" is created
    <%
    %>
    But my problem is that i don't know the first parameter which
    correspond
    to aclName .
    Any suggestions are welcome .
    Thanks for help .

  • Class extending a Frame with main method in it - how do I use the methods?

    Howdy.
    Having a problem.. I want my "main" class, ie. the class with the main method in it to extend a Frame class.. because the main method is static, I can't use Frame's methods.
    What's a trick to get around this ? I am making a deliberate design decision to extend the Frame class, because I thought it was.. well.. better. I could always just create a Frame object and utilise it.. but from little things I've read and seen it's better to extend it.
    When I use Forte to make a Frame program it sets up a constructor/etc. for the main class and then it does something akin to this (the class is called MazeGenerator) :
    public static void main(String args[]) {
    new MazeGenerator().show();
    What does "new MazeGenerator().show();" do when it's not being associated to an object handle ??
    Ta.
    - Scutt.

    Create an instance of the frame in main then the constructor can control it. Or you could add an init method or something:
    class MyFrame extends Frame {
    public static void main (String [] args) {
    MyFrame frame = new MyFrame();
    frame.init();
    You don't necessarily have to have a reference to an Object in order to create one. All the work can be done in the constructor (something I'm not really fond of however)

  • What is the method used for upload of  data

    Hi All,
    What is the method used for upload of  Data from excel spread sheets to SAP HR.
    it is Bulk Data from many countries.LSMW or BDC Session Method?
    what are country specific infotypes used for PA and OM.
    can u plz give the list of country specific infotypes used for PA n OM Module.
    Thanks
    Archana

    Hi Archana,
    To Upload bulk data I think BDC is the best and effecient way.
    Regarding Infotypes we dont have any country specific Infotypes in OM & PA. In Payroll we do have according to country wise.
    I hope you had understood the point
    Regards
    Pavani
    Remainder: Points to be given on answers

  • I want to use the method getRemotePort() in a jsp page.....................

    I have tried using it like this:
    <%@ page import="java.net.*"%>
    <%@ page import="java.util.*"%>
    <%@ page import = "javax.servlet.*"%>
    <%
    out.println("<br>Remote Port : " +
    request.getRemotePort());
    %>
    I get the following error:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 4 in the jsp file: /test/cookie.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Tomcat\work\Standalone\localhost\_\test\cookie_jsp.java:51: cannot resolve symbol
    symbol : method getRemotePort ()
    location: interface javax.servlet.http.HttpServletRequest
    request.getRemotePort());
    ^
    1 error
    I think i need to import some page but am not sure which one. Can someone help on this please?

    well im using tomcat 4.1. Is there another way of getting the same information on the latest servlets? I mean instead of using getRemotePort() are there any other methods used in the latest servletes to get the same information?

  • How to use the method getParameterValues() of request object in JSP?

    I'm trying to use the method
    String a[]=request.getParameterValues("ch_box");
    to retrieve the values from the form
    but it gives the error
    "Method getParamaterValues(java.lang.String) not found in interface javax.servlet.http.HttpServletRequest."
    so plz tell me how to overcome this hurdle?
    thanx

    Well, just one note... either you have a typo in your code, or else in your post.
    If you cut and pasted the error message (which it looks like you did), then the method getParamaterValues() should be getParameterValues() instead (notice the spelling difference), so you probably just have a typo in your code.

  • How to use the method "getChildrenRemoved()" declared in ElementChange?

    How to use the method "getChildrenRemoved()" declared in DocumentEvent.ElementChange?

    I have tried to use it,but the code below alway say "Yes"....
    I really have no ideas about why ec is always a null.
    public void removeUpdate(DocumentEvent ee) {
           DocumentEvent.ElementChange ec = ee.getChange(doc.getDefaultRootElement());
           if(ec == null)
              System.out.println("Yes");
                     }

  • Using derived obj as a parameter in one of the methods

    Hi
    I have a class "class1", which is the parent class. Another class "class2" is derived from class1 (extends class1)
    In class3, there is a method "method3" that uses "class1" obj as a parameter.
    I need to call the same method "method3" in class2 also, by passing "class2" obj as a parameter.
    Is there a way that I can do this.
    Any help is greatly appreciated.

    If the method takes a "class1" type as an argument, then you can pass it anything which is of type "class1" or extends from it. So yes you can pass that same method a "class2" type.

  • HT201303 last time i bought apps by using visa gift card so iam trying to use the kind of visa gift card and the system is denying the method payment ....any idea how to solve this with my itune account ?

    last time i bought apps by using visa gift card so iam trying to use the kind of visa gift card and the system is denying the method payment ....any idea how to solve this with my itune account ?

    A few reasons I can think of, but instead of shooting in the dark, lets check with experts who can look at your account.
    iTunes Store Support
    http://www.apple.com/emea/support/itunes/contact.html

  • How can we call the method of used controller?

    Hi All,
       i created two WDA Applications.( like YWDA1,YWDA2 ) . i am using the component WDA2 in WDA 1.and displaying the one view of WDA2 as popup window in WDA1 on action of one of the input element in the view of WDA1 by using the method l_window_manager->create_window_for_cmp_usage
    I have a button on the view of WDA2 which has appear in the popup window...how can i call the method which has binded to that button....and where should i code that...and i need to assign selected value in the popup window to input elemetn of view  WDA1
    Please help me to resolve this....
    Regards,
    Ravi

    You can not directly call view's event handler from other component.
    create a method in component controller of the second component and in the button click call the component controller method. ( also make the method as interface so that you can call it from other components )
    Now, you can call the interfacecontroller's method
    DATA: l_ref_INTERFACECONTROLLER TYPE REF TO ZIWCI__VSTX_REBATE_REQ_WD .
      l_ref_INTERFACECONTROLLER =   wd_This->wd_CpIfc_<comp usage name>( ).
      l_ref_INTERFACECONTROLLER->Save_Rr(
        STATUS = '01'                       " Zvstxrrstatus
    save_rr is the method of second component controller

  • How to use my findTheHighest method to find the highest value in my two dim

    I am going to create a 13row by 10 colume two dimensional array.
    how to use my findTheHighest method to find the highest value in my two dimensional array.
    .When i compile this program , i got those as following;
    "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsExce
    at TaxEvolution.findTheHighest(TaxEvolution.java:31)
    at TaxEvolutionClient.main(TaxEvolutionClient.java:25)"
    public class TaxEvolution{
    public double[][] salesTaxRates;
    public TaxEvolution()
      salesTaxRates = new double[13][10];
      fillProvinTaxRates();
    private void fillProvinTaxRates()
      for ( int row = 0; row < salesTaxRates.length; row++ )
        for ( int column = 0; column < salesTaxRates[row].length; column++ )
          salesTaxRates[row][column]= (int)(Math.random()*5000) + 1;
    public double findTheHighest()
        double highest = salesTaxRates[0][0];
        for ( int row = 0; row <= salesTaxRates.length; row++ )
          for ( int column = 0; column <= salesTaxRates[row].length; column++ )
             if ( salesTaxRates[row][column] >= highest )
                   highest = salesTaxRates[row][column];
        return highest;   
    public double[][] arrayTaxEvolution()
      double[][] returnTaxRates = new double[13][10];
      for ( int row = 0; row < salesTaxRates.length; row++ )
        for ( int column = 0; column < salesTaxRates[row].length; column++ )
          returnTaxRates = salesTaxRates;
      return returnTaxRates;
    public class TaxEvolutionClient{
    public static void main( String[] args ){
      TaxEvolution protaxRateList = new TaxEvolution();
      double[][] taxRateList = protaxRateList.arrayTaxEvolution();
        for ( int i = 0; i < taxRateList.length; i++ )
          for ( int j = 0; j < taxRateList[0].length; j++ )
            System.out.print( taxRateList[i][j] + "\t" );               
            System.out.print( protaxRateList.findTheHighest + "\t" );
    }

    Multiposted
    http://forum.java.sun.com/thread.jspa?threadID=699057&tstart=0

  • Which java keyword cannot be used inside the body of a static method?

    Which java keyword cannot be used inside the body of a static method, but may be used without problems in a non-static method?

    But javac doesn't complain. So I was not partially wrong -- I was completely wrong.It's still better not to use the "this", though. When you explictly reference a static member via an instance reference (theFoo.bar or this.bar, as opposed to Foo.bar) the JLS requires a check that the reference is non-null. Clearly "this" is always non-null, but javac still puts in half of the check. Take the simple class public class Test {
        static int field;
        public void setField(int i) {this.field=i;}
        public void staticSetField(int i) {field=i;}
    } and observe the bytecodes produced: $ javap -c Test
    Compiled from "Test.java"
    public class Test extends java.lang.Object{
    static int field;
    public Test();
      Code:
       0:   aload_0
       1:   invokespecial   #1; //Method java/lang/Object."<init>":()V
       4:   return
    public void setField(int);
      Code:
       0:   aload_0
       1:   pop
       2:   iload_1
       3:   putstatic       #2; //Field field:I
       6:   return
    public void staticSetField(int);
      Code:
       0:   iload_1
       1:   putstatic       #2; //Field field:I
       4:   return
    }The JIT will get rid of it, but you may as well avoid the waste in the first place. (And if you really do want to check that the reference is non-null, do the check explicitly so that maintainers know it's intentional).

  • What are the methods used for creating customer

    i have to upload a text file and create customer using idoc .can any one suggest the methods used to fullfil this requirement

    Hi,
    Upload the file using the function module GUI_UPLOAD into an internal table then try to pass the values from the file to the segments in the idoc DEBMAS03 using the function module MASTERIDOC_CREATE_DEBMAS to create the customer.
    Any doubts regarding you can clarify.
    Thanks&Regards
    Sarves

Maybe you are looking for

  • Problem installing App Server 8.1 on Linux

    I've got App server 8.1 that came with a Messaging Server bundle. I tried installing on a new machine, and it wouldn't go through with the full configuation at the time of install, so I took the "configure later" option. I'm now trying to manually co

  • Radeon 9800 pro & classic?

    Is there any workaround to get classic to boot with extensions? (ATI's site says it's unsupported)

  • IPhoto 9 library first aid really won't open

    I see others have posted this problem and the fixes worked for them...however I have tried deleting relevant plists and preferences as suggested by Old Toad and others on similar threads and i have opened the app while holding down command + option k

  • Application server B.I start issue

    Good Morning, Kindly help out on this issue , i tried starting the services on the Application server for the infrastructure tier of my B.I. and i get this error, i have checked my /etc/host file and i can find 127.0.0.1 localhost loopback -a:applpro

  • NullPointerException creating TopLink objects

    Hello, I'm developing an application with JDeveloper 10g, which uses an Oracle 8.1 database. At the beginning I try to create the Data Model using TopLink. I select two tables that I want to be represented as TopLink objects. But just after I click "