小编Jay*_*rio的帖子

How to use getWidth() and getHeight() to center the star shape in java

I'm having problem centering the star shape. The problem is that I hard coded the points for each coordinate. And the problem with this is that Im not getting the right position although I created a perfect 5 star. On more problem is that what if I want to rescale the shape to make it bigger or small by clicking a button? Here's my code.

public void run() {
            DifferentShapes panel = new DifferentShapes();
            JFrame frame = new JFrame("Different Shapes"); …
Run Code Online (Sandbox Code Playgroud)

java swing

1
推荐指数
1
解决办法
1601
查看次数

标签 统计

java ×1

swing ×1