Skip to content

DockUI initialization error with JDK 23 #72

@ghackenberg

Description

@ghackenberg

The function bibliothek.gui.DockUI.registerColors throws an exception with JDK 23 (and possibly others):

private void registerColors(){
   registerColors( ".+", new DefaultLookAndFeelColors() );
        
   String version = System.getProperty( "java.version" );
   int begin = version.indexOf( '.' ) + 1;
   int end = version.indexOf( '.', begin );

   // ### HERE ###
   int major = Integer.parseInt( version.substring( begin, end ));
   // ### HERE ###

   if( major >= 7 ){
      registerColors( "javax\\.swing\\.plaf\\.nimbus\\.NimbusLookAndFeel", new Nimbus6u10() );
   }
   else{
      registerColors( "com\\.sun\\.java\\.swing\\.plaf\\.nimbus\\.NimbusLookAndFeel", new Nimbus6u10() );
   }
   registerColors( "com\\.sun\\.java\\.swing\\.plaf\\.windows\\.WindowsLookAndFeel", new Windows() );
}

Here is a quick fix to solve the problem, which you need to execute before using the dockingframes library:

String version = System.getProperty("java.version");
if (!version.contains(".")) {
   System.setProperty("java.version", "1." + version + ".0");	
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions