Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing Clock #6

Open
jeremie76 opened this issue Oct 14, 2013 · 1 comment
Open

Resizing Clock #6

jeremie76 opened this issue Oct 14, 2013 · 1 comment

Comments

@jeremie76
Copy link

Hello,

I try to use the clock component. It work's good but I have some problems when I want to resize the frame :
the clock is not well painted when the frame is not a square.

Here the source code to see the problem (try to increase only the width of the frame to see it) :

public class TestClock {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}

private static void createAndShowGUI() {
    JFrame frame = new JFrame("ClockDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    Clock c = new Clock();
    c.setPreferredSize(new Dimension(200, 150));
    frame.getContentPane().add(c, BorderLayout.CENTER);     

    frame.pack();
    frame.setSize(600,200);
    frame.setVisible(true);
}

}

I think there is a problem in the Clock.java :
In public void setSize(final int WIDTH, final int HEIGHT)
and setBounds(final int X, final int Y, final int WIDTH, final int HEIGHT) for example,
Clock::calcInnerBounds() is called, INNER_BOUNDS is updated but after it is GAUGE_BOUNDS that is used.

Clock::calcInnerBounds() is different of AbstractRadial::calcInnerBounds(...) who update INNER_BOUNDS and GAUGE_BOUNDS...
So I think that GAUGE_BOUNDS is never updated or I miss something in my code...

Jeremie

@krheinwald
Copy link

See #7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants