How do I resize images inside an application when the application window is resized?

前端 未结 2 977
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 17:10

When I maximize my application, the images inside of the JPanel don\'t resize with it. How can I make the JPanel and its contents adjust when the window is maximized?

<
2条回答
  •  隐瞒了意图╮
    2020-11-28 17:25

    One crude way..

    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.draw(image,0,0,getWidth(),getHeight(),this);
        // ..
    

提交回复
热议问题