Hello...
I have implementd a user interface and I need to update the user interface every 5secs widout requiring to draw the entire JFrame again..

is dre anything that can help me change my textfield values every 5secs without affecting the other issues on my interface??

You can do this easily with a Timer.

commented: Your The Best +1

Actually I have already implemented a code to retrieve the values that are to be shown on the UI but I am facing difficulty in showing them on the JFrame i.e in the JTextFields..

The textfields show no content...

What do you think can my mistake be possibly??

I have no idea, since you didn't post any of that code here, and that has nothing to do with the question that you did ask.

public static void tri() {
       
        
        ClassLoadingMXBean classmxbean = ManagementFactory.getClassLoadingMXBean();
        ThreadMXBean threadmxbean = ManagementFactory.getThreadMXBean();

int thread_count = threadmxbean.getThreadCount();
        int peak_thread_count = threadmxbean.getPeakThreadCount();
        int daemon_thread_count = threadmxbean.getDaemonThreadCount();

Trail1 tt = new Trail1();
       
        try {

tt.thrd_ct.setText(Integer.toString(thread_count));
              tt.pk_thrd_ct.setText(Integer.toString(peak_thread_count));
              tt.demon_thrd_ct.setText(Integer.toString(daemon_thread_count));

tt.thrd_ct.repaint();
              tt.pk_thrd_ct.repaint();
              tt.demon_thrd_ct.repaint();

} catch (NullPointerException e) {
        
         
         }
    }  
 }


public class Trail1 {

public static JTextField thrd_ct;
    public static JTextField pk_thrd_ct;
    public static JTextField demon_thrd_ct;

 public void tri1() {
     
       JFrame frme = new JFrame();
JLabel thrd_cnt = new JLabel();
       JLabel peak_thrd_cnt = new JLabel();
       JLabel demon_thrd_cnt = new JLabel();

JTextField thrd_ct = new JTextField();
       JTextField pk_thrd_ct = new JTextField();
       JTextField demon_thrd_ct = new JTextField();

 thrd_cnt.setText("Thread Count");
       thrd_cnt.setBounds(100,180,200,50);
       thrd_cnt.setFont(new java.awt.Font("Palatino Linotype", 1, 20));
       
       peak_thrd_cnt.setText("Peak Thread Count");
       peak_thrd_cnt.setBounds(100,220,250,50);
       peak_thrd_cnt.setFont(new java.awt.Font("Palatino Linotype", 1, 20));
       
       demon_thrd_cnt.setText("Daemon Thread Count");
       demon_thrd_cnt.setBounds(100,260,250,50);
       demon_thrd_cnt.setFont(new java.awt.Font("Palatino Linotype", 1, 20));

thrd_ct.setBounds(500,180,100,30);
       thrd_ct.setFont(new java.awt.Font("Palatine Linotype", 1, 20));
       
       pk_thrd_ct.setBounds(500,220,100,30);
       pk_thrd_ct.setFont(new java.awt.Font("Palatine Linotype", 1, 20));
       
       demon_thrd_ct.setBounds(500,260,100,30);
       demon_thrd_ct.setFont(new java.awt.Font("Palatine Linotype", 1, 20));

frme.getContentPane().add(thrd_cnt);
       frme.getContentPane().add(peak_thrd_cnt);
       frme.getContentPane().add(demon_thrd_cnt);

 frme.getContentPane().add(thrd_ct);
       frme.getContentPane().add(pk_thrd_ct);
       frme.getContentPane().add(demon_thrd_ct);

frme.setTitle("JVM Monitoring");
  	frme.setLocation(new Point(0, 0));
  	frme.setSize(new Dimension(1100, 800));
  	frme.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  	frme.setResizable(false); 
        frme.setLayout(null);
       
         frme.setVisible(true);      
         frme.getContentPane().setVisible(true);
         frme.validate();
         frme.getContentPane().validate();        
 }   
}

I am creating the JFrame in Trail1 class..
Creating an instance of it in the Trial() class..
The tri() function is in a loop that executes to bring the values every 1000 secs...

Hope the idea is clear...

Please try and help..its really important..
I am trying this since long...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.