As is clear from the semantics, each do loop can be replaced with an equivalent while loop. However, to do so, we need to duplicate the body of the do loop.
Example:
int i; do { i = Integer.parseInt(JOptionPane.showInputDialog( "Input a positive integer")); } while (i <= 0);
equivale a
int i; i = Integer.parseInt(JOptionPane.showInputDialog( "Input a positive integer")); while (i <= 0) { i = Integer.parseInt(JOptionPane.showInputDialog( "Input a positive integer")); }