As a matter of kindness to you (and anyone else reading this), I'll post the existing code properly indented; however, no one here is going to fix the problem for you. We will give advice, but not free homework answers. In any case, the answer was already given to you above - use javax.swing.Timer, which will run without blocking the overall thread. See this tutorial for more details on how to use it.
As for the urgency of the problem... well, keep in mind that it isn't urgent to us, and that we are here mostly to help you learn, not to help you finish your homework. See this essay for further Illumination fnord.
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import sun.audio.*;
class Stop_Clock {
static boolean flag=true;
public static void main(String argsp[]) {
JFrame frame=new JFrame("Stop Clock");
frame.setResizable(false);
JLabel lbl=new JLabel(new ImageIcon("Stop CLock.png"));
frame.setIconImage(new ImageIcon("078474-blue-jelly-icon-business-clock8.png").getImage());
lbl.setLayout(null);
final JLabel mins=new JLabel(" 00");
mins.setFont(new Font("Impact", Font.BOLD, 45));
mins.setBounds(125, 80, 75, 44);
final JLabel secs=new JLabel(" 00");
secs.setFont(new Font("Impact", Font.BOLD, 45));
secs.setBounds(244,80, 75, 44);
final JLabel msecs=new JLabel(" 000");
msecs.setFont(new Font("Impact", Font.BOLD, 45));
msecs.setBounds(355, 80, 95, 44);
lbl.add(msecs);
lbl.add(secs);
lbl.add(mins);
final JLabel start=new JLabel();
start.setBounds(11,173,181,57);
lbl.add(start);
start.addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent e) {
start.setIcon(new ImageIcon("start-changed.png"));
}
public void mouseExited(MouseEvent e) {
start.setIcon(new ImageIcon("start.png"));
}
public void mouseClicked(MouseEvent e) {
flag=true;
int sec=1, msec=1, min=1;
while(flag==true) {
sec=1;
while(sec<=60&&flag==true) {
msec=1;
while(msec<=1000&&flag==true) {
try {
Thread.sleep(1);
}
catch(InterruptedException error) {}
String str=String.format(" %03d",msec);
if(msec==1000) msecs.setText(" 000");
else msecs.setText(str);
msec++;
}
String str1=String.format(" %02d",sec);
if(sec==60) secs.setText(" 00");
else secs.setText(str1);
sec++;
}
String str2=String.format(" %02d", min);
mins.setText(str2);
min++;
}
}
});
final JLabel stop=new JLabel();
stop.setBounds(349, 173, 181,57);
lbl.add(stop);
stop.addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent e) {
stop.setIcon(new ImageIcon("stop-changed.png"));
}
public void mouseExited(MouseEvent e) {
stop.setIcon(new ImageIcon("stop.png"));
}
public void mouseClicked(MouseEvent e) {
flag=false;
msecs.setText(" 000");
secs.setText(" 00");
mins.setText(" 00");
}
});
final JLabel reset=new JLabel();
reset.setBounds(216,178,113,47);
lbl.add(reset);
reset.addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent e) {
reset.setIcon(new ImageIcon("reset-changed.png"));
}
public void mouseExited(MouseEvent e) {
reset.setIcon(new ImageIcon("reset.png"));
}
public void mouseClicked(MouseEvent e) {
flag=false;
}
});
frame.add(lbl, "Center");
frame.pack();
frame.show();
}
}