public static void setText(ArrayList<JavaProcess> newLabel){
		
		newLabels = newLabel;
		labelListValue = labelList.size()/6;
		newLabelsValue = newLabels.size();	
		
		//System.out.println(newLabels.size() + " "+ labelList.size());
		
		if(newLabelsValue < labelListValue){
			
			SwingUtilities.invokeLater(new Runnable(){
			    public void run(){
			  
					for(int i=((labelListValue-newLabels.size())*6); i>0;i--){
						gui.frame.remove(labelList.get(i));
						labelList.remove(i);
						
					}	
					
				}
			}); 
		}
		
		if(newLabelsValue > labelListValue){
			
			SwingUtilities.invokeLater(new Runnable(){
			    public void run(){
			    	
			
					for(int i=0; i<(newLabelsValue-labelListValue);i++){
						labelList.add(new JLabel("",SwingConstants.CENTER));
						labelList.add(new JLabel("",SwingConstants.CENTER));
						labelList.add(new JLabel("",SwingConstants.CENTER));
						labelList.add(new JLabel("",SwingConstants.CENTER));
						labelList.add(new JLabel("",SwingConstants.CENTER));
						labelList.add(new JLabel("",SwingConstants.CENTER));
					}
					
					for(int i=labelListValue; i <labelList.size();i++){
						//labelList.get(i).setBorder(BorderFactory.createEtchedBorder());
						labelList.get(i).setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
						gui.frame.add(labelList.get(i));
						
					}
					
				}
			}); 
		}
		
		SwingUtilities.invokeLater(new Runnable(){
		    public void run(){
		    	
		    	int i=0;int j=1;
		    	for(JavaProcess jps: newLabels){
		    	
		    		if(j==1){
		    			labelList.get(i).setOpaque(false);
		    			labelList.get(i++).setText(jps.getName());
		    			labelList.get(i).setOpaque(false);
			    		labelList.get(i++).setText(jps.getCPU());
			    		labelList.get(i).setOpaque(false);
			    		labelList.get(i++).setText(jps.getMem());
			    		labelList.get(i).setOpaque(false);
			    		labelList.get(i++).setText(jps.getTime());
			    		labelList.get(i).setOpaque(false);
			    		labelList.get(i++).setText(jps.getMaxCpu());
			    		labelList.get(i).setOpaque(false);
			    		labelList.get(i++).setText(jps.getMaxMem());
			    		
			    		j++;
		    		} else { 

			    		labelList.get(i).setBackground(Color.LIGHT_GRAY);
			    		labelList.get(i).setOpaque(true);
			    		labelList.get(i++).setText(jps.getName());
			    		
			    		labelList.get(i).setBackground(Color.LIGHT_GRAY);
			    		labelList.get(i).setOpaque(true);
			    		labelList.get(i++).setText(jps.getCPU());
			    		
			    		labelList.get(i).setBackground(Color.LIGHT_GRAY);
			    		labelList.get(i).setOpaque(true);
			    		labelList.get(i++).setText(jps.getMem());
			    		
			    		labelList.get(i).setBackground(Color.LIGHT_GRAY);
			    		labelList.get(i).setOpaque(true);
			    		labelList.get(i++).setText(jps.getTime());
			    		
			    		labelList.get(i).setBackground(Color.LIGHT_GRAY);
			    		labelList.get(i).setOpaque(true);
			    		labelList.get(i++).setText(jps.getMaxCpu());
			    		
			    		labelList.get(i).setBackground(Color.LIGHT_GRAY);
			    		labelList.get(i).setOpaque(true);
			    		labelList.get(i++).setText(jps.getMaxMem());
			    				    		
		    			j=1;
		    		}
		    	}
		    	newLabels=null;
		    	gui.frame.pack();
		    	
		   
		    }
		}); 	
		
		if(firstRun){
			firstRun=false;
			gui.frame.setVisible(true);
		}
		
	}