How to make the Windows 7 loading bar in the taskbar

I want to create a Windows 7 boot bar in the taskbar. something like that: This is what I want

I already have a jframe where the game loads into it. I want the loading bar to show the progress of loading the game cache. Jframe and download are processed in two separate classes.

When I looked on the Internet, I found 2 solutions.

  • SWT: where you can create a loading panel, but I think you cannot combine this with jframe.

  • bridj: what can be added to jframe, but I don’t know how to do it with existing jframe, and progress and jframe are processed in two different classes.

+4
source share
1 answer

, , , trashgod .
, , , , .
, , . !

private static class ProgressIcon implements Icon {

    private static final int H = 16;
    private static final int W = 3 * H;
    private Color color;
    private int w;

    public ProgressIcon(Color color) {
        this.color = color;
    }

    public void update(int i) {
        w = i % W;
    }

    public void paintIcon(Component c, Graphics g, int x, int y) {
        g.setColor(color);
        g.fillRect(x, y, w, H);
    }

    public int getIconWidth() {
        return W;
    }

    public int getIconHeight() {
        return H;
    }
}
0

Source: https://habr.com/ru/post/1606972/


All Articles