W
W
Way2015-06-15 15:05:57
Java
Way, 2015-06-15 15:05:57

How to make radial progress bar(Picture)?

In general, there is a picture of a radial (round) progress bar. How to make the progress bar itself filled when loading (for example, files).
If anyone needs it, here is the code for the standard (my) progress bar. Ps and if possible an example.

BufferedImage img = genButton(loadbarW, loadbarH, bar);
      try
      {
        int percentw = (int)(t.procents * loadbarW / 100);
        g.drawImage(img.getSubimage(0, 0, percentw, loadbarH), loadbarX, loadbarY, null);
        g.drawImage(bar_label, (loadbarX + percentw) - (bar_label.getWidth() / 2), loadbarY - bar_label.getHeight(), null);
        g.drawString(t.procents + "%", (loadbarX + percentw) - (g.getFontMetrics().stringWidth(t.procents + "%") / 2), loadbarY - (bar_label.getHeight() / 2));
      } catch(Exception e){}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aornos, 2015-06-16
@aornos

here is a good solution: anthonyterrien.com/knob

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question