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 6820227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:24:00+00:00 2026-05-26T21:24:00+00:00

I am at a very strange problem, I have a customized JPanel, which I

  • 0

I am at a very strange problem, I have a customized JPanel, which I want to draw a circle, but nothing happens … here is my source, hope somebody sees the mistake, I can’t find it.

import javax.swing.JPanel;

public class CircleView extends JPanel {

public CircleView() {}

@Override
    public void paintComponent(Graphics g) {
    g.setColor(Color.red);
    g.drawOval(10, 10, 50, 50);
    }
}
  • 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-05-26T21:24:00+00:00Added an answer on May 26, 2026 at 9:24 pm

    that not true at all

    Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
            at KondorExport.Util.Helping.CustomComponent12.<init>(CustomComponent12.java:19)
            at KondorExport.Util.Helping.CustomComponent12$1.run(CustomComponent12.java:37)
            at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    Caused by: java.lang.RuntimeException: Uncompilable source code - class CircleView is public, should be declared in a file named CircleView.java
            at KondorExport.Util.Helping.CircleView.<clinit>(CustomComponent12.java:44)
            ... 10 more
    

    1) remove constructor

    2) add super.paintComponent(g);

    this one can run

    class CircleView extends JPanel {
    
        private static final long serialVersionUID = 1L;
    
        @Override
        public Dimension getPreferredSize() {
            return new Dimension(100, 100);
        }
    
        @Override
        public void paintComponent(Graphics g) {
            int margin = 10;
            Dimension dim = getSize();
            super.paintComponent(g);
            g.setColor(Color.red);
            g.drawOval(margin, margin, dim.width - margin * 2, dim.height - margin * 2);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a very strange problem with Apache .htaccess URL Rewriting and Redirection. Here's my
I have one of our projects very strange problem here on http://konyak.georates.net/page-2/ we have
We have a very strange problem which we have yet to be able to
I have a very strange problem, which took already several hours of my attention:
I have a very strange problem. I have an AsyncTask which appears to block
I have a very strange problem with a ColorAnimation. What I want to do
I have a very strange problem with Visual Source Safe. I use VSS as
I have a very very strange problem here. I have a desktop application written
I got very strange problem. I have one php website which is running in
i have a very strange problem which i cannot solve at the moment. i

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.