Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8581057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:57:32+00:00 2026-06-11T20:57:32+00:00

Running a swing application in java, and I got this exception in my program.

  • 0

Running a swing application in java, and I got this exception in my program. It’s worth noting that this does not show up every time I run the program.

Full stack trace :

Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.backend.utils.importing.Loading$1.run(Loading.java:54)
    at org.backend.utils.importing.Loading.loadEverything(Loading.java:61)
    at org.main.BishopCarrollSchoolTracker.main(BishopCarrollSchoolTracker.java:70)
Caused by: java.lang.ClassCastException: javax.swing.plaf.FontUIResource cannot be cast to javax.swing.InputMap
    at javax.swing.plaf.basic.BasicButtonListener.getInputMap(BasicButtonListener.java:102)
    at javax.swing.plaf.basic.BasicButtonListener.installKeyboardActions(BasicButtonListener.java:78)
    at javax.swing.plaf.basic.BasicButtonUI.installKeyboardActions(BasicButtonUI.java:121)
    at javax.swing.plaf.basic.BasicButtonUI.installUI(BasicButtonUI.java:73)
    at javax.swing.JComponent.setUI(JComponent.java:662)
    at javax.swing.AbstractButton.setUI(AbstractButton.java:1782)
    at javax.swing.plaf.synth.SynthArrowButton.updateUI(SynthArrowButton.java:34)
    at javax.swing.AbstractButton.init(AbstractButton.java:2149)
    at javax.swing.JButton.<init>(JButton.java:118)
    at javax.swing.JButton.<init>(JButton.java:73)
    at javax.swing.plaf.synth.SynthArrowButton.<init>(SynthArrowButton.java:23)
    at javax.swing.plaf.synth.SynthScrollBarUI$2.<init>(SynthScrollBarUI.java:325)
    at javax.swing.plaf.synth.SynthScrollBarUI.createIncreaseButton(SynthScrollBarUI.java:325)
    at javax.swing.plaf.basic.BasicScrollBarUI.installComponents(BasicScrollBarUI.java:225)
    at javax.swing.plaf.basic.BasicScrollBarUI.installUI(BasicScrollBarUI.java:147)
    at javax.swing.JComponent.setUI(JComponent.java:662)
    at javax.swing.JScrollBar.setUI(JScrollBar.java:190)
    at javax.swing.JScrollBar.updateUI(JScrollBar.java:210)
    at javax.swing.JScrollBar.<init>(JScrollBar.java:144)
    at javax.swing.JScrollBar.<init>(JScrollBar.java:159)
    at javax.swing.JScrollPane$ScrollBar.<init>(JScrollPane.java:698)
    at javax.swing.JScrollPane.createHorizontalScrollBar(JScrollPane.java:794)
    at javax.swing.JScrollPane.<init>(JScrollPane.java:282)
    at javax.swing.JScrollPane.<init>(JScrollPane.java:305)
    at org.gui.base.generic.panels.ListTablePanel.<init>(ListTablePanel.java:44)
    at org.gui.base.main.internal.WorkPanel.<init>(WorkPanel.java:28)
    at org.gui.base.main.internal.InternalPanel.<clinit>(InternalPanel.java:38)
    ... 3 more

Lines causing exception (In my source code) :

public static final WorkPanel WORK = new WorkPanel();

Goes to

super(new WorkTable(AllWork.getElements(), true, true, true, true, true, true, true),
            new WorkTable(AllWork.getElements(), true, true, true, true, true, true, true, true));

To

public ListTablePanel(RefreshableTable m, RefreshableTable t) {
    this.main = m;
    this.totals = t;

    setLayout(LayoutFactory.createLayout());

    JScrollPane pane = new JScrollPane(main);

    main.setAutoCreateRowSorter(false);

    totals.setFont(totals.getFont().deriveFont(Font.BOLD));
    totals.setEnabled(false);

    pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);

    add(pane, LayoutFactory.newFactory().setFill(GridBagConstraints.BOTH).
            setY(0).setWeightX(1).setWeightY(1));
    add(totals, LayoutFactory.newFactory().setFill(GridBagConstraints.BOTH).
            setY(1).setWeightX(1).setInsets(new Insets(0, 2, 0, 17)));
}

The last piece of code in my source code is the construction of JScrollPane.

I don’t understand why this exception is thrown.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:57:33+00:00Added an answer on June 11, 2026 at 8:57 pm

    Any time I see this:

    Running a swing application in java, and I got this exception in my program. It’s worth noting that this does not show up every time I run the program.

    Alarm bells go off in my head, and I think “am I handling Swing threading correctly”? Because it is not uncommon for Swing thread mishaps to cause strange errors that don’t always occur.

    So, are you handing Swing threading correctly, by first of all initiating and displaying the Swing GUI on the event thread? i.e.,

    private static void createAndShowGui() {
    
      // create and display my GUI here
    
    }
    
    public static void main(String[] args) {
      SwingUtilities.invokeLater(new Runnable() {
         public void run() {
            createAndShowGui();
         }
      });
    }
    

    By the way, you’re not using Nimbus or another look and feel?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My system: I have a java swing application that is running on Solaris 10/X86
I'm working on a Swing application (currently running on Java 1.6 update 11) which
I wrote a Java (Swing) application on Windows, and tried running it on Mac.
Recently I noted that some applications are running on javaw (not in java ).
Possible Duplicate: Java Full Screen Program (Swing) -Tab/ALT F4 I've got a full screen
I have a Java Swing application, that has many JTextFields and a datamodel. When
I have a Swing application running on Java 1.6.0_20 on Windows XP (32-bit). I
I have a Swing Application running under Linux, that has problems to display accented
I'm working on a java swing application that will be used in a psychology
In a Java Swing desktop application running on Linux (e.g., Ubuntu), how can the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.