You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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();
}
});
}
}
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
The text was updated successfully, but these errors were encountered: