Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Page 1 of 2 12 LastLast
Results 1 to 25 of 38

Thread: cannot find symbol:getSystemCpuLoad()

  1. #1
    Member
    Join Date
    Mar 2014
    Posts
    70
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default cannot find symbol:getSystemCpuLoad()

    Hi.
    What's the problem with my errorring line?
    import java.io.*;
    import java.util.*;
    import java.util.concurrent.TimeUnit;
    import com.sun.management.OperatingSystemMXBean;
    import java.lang.management.ManagementFactory;
    import java.lang.System;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
     
        public class sysinfoHooshi implements ActionListener{
        		class Info{			
    			public String name;
    			public String version;
    			public String arch;
    			public double ramUtil;
    			public double CPUUtil;
    		};
      ...  
    	public  void simulate()throws Exception{
     
    	this.showDialog();
    	...	
     
     
    		Info[] queue = new Info[queueSize];
     
    		....
     
    		for(int i=0;i<queueSize;++i)
    		  queue[i]  = new Info();
     
     
    		for(int i=0;i<queueSize;++i)
    		{
    		...
    			queue[pos].CPUUtil = ( osBean.getSystemCpuLoad() ) * 100;//ERROR
    			++pos;
    		}//end for  
    		....
     
    	}//end simulate()
     
    	public void showDialog()
    	{
    ...
    	}
    	 public void actionPerformed(ActionEvent e) {
              ...
    	}
     
    	public void showQueryDialog()
    	{
    ...
    	}
     
     
     
    	public static void main(String args[]) throws Exception{	
    ...
     
    	} // end main
       }// end class


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,612
    My Mood
    Hungover
    Thanks
    145
    Thanked 658 Times in 563 Posts

    Default Re: cannot find symbol:getSystemCpuLoad()

    Surely you must know this isn't how you ask questions by now.

    You tell us. What is the exact text of the error? What type is osBean? What functions does that type have?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Member
    Join Date
    Mar 2014
    Posts
    70
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default Re: cannot find symbol:getSystemCpuLoad()

    Quote Originally Posted by KevinWorkman View Post
    Surely you must know this isn't how you ask questions by now.

    You tell us. What is the exact text of the error? What type is osBean? What functions does that type have?
    osBean is defined as:
    OperatingSystemMXBean osBean = (com.sun.management.OperatingSystemMXBean)
    			ManagementFactory.getOperatingSystemMXBean();
    and the error text reads:
    sysinfoHooshi.java:64: cannot find symbol
    location: interface com.sun.management.OperatingSystemMXBean
    			queue[pos].CPUUtil = ( osBean.getSystemCpuLoad() ) * 100;
    1 error
                                                          ^

  4. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,612
    My Mood
    Hungover
    Thanks
    145
    Thanked 658 Times in 563 Posts

    Default Re: cannot find symbol:getSystemCpuLoad()

    Are you sure the type of osBean is com.sun.management and not java.lang.management?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    Member
    Join Date
    Mar 2014
    Posts
    70
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default Re: cannot find symbol:getSystemCpuLoad()

    Yes, that is how I declared it.

    The for-loop has in its body:
    OperatingSystemMXBean osBean = (com.sun.management.OperatingSystemMXBean)
    			ManagementFactory.getOperatingSystemMXBean();
     	queue[pos].ramUtil =100-( osBean.getFreePhysicalMemorySize()/osBean.getTotalPhysicalMemorySize() ) * 100;		
    			queue[pos].CPUUtil = ( osBean.getSystemCpuLoad() ) * 100;

  6. #6
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,612
    My Mood
    Hungover
    Thanks
    145
    Thanked 658 Times in 563 Posts

    Default Re: cannot find symbol:getSystemCpuLoad()

    You need to post an MCVE that demonstrates exactly what you're doing. This works fine for me:

    import java.lang.management.ManagementFactory;
    import com.sun.management.OperatingSystemMXBean;
     
    public class Test {
    	public static void main (String [] args){
     
    		OperatingSystemMXBean osBean = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
     
    		double x = osBean.getSystemCpuLoad();
     
    		System.out.println(x);
     
    	}
    }

    Chances are you'll find your error in the process of creating the MCVE. Good luck.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #7
    Member
    Join Date
    Mar 2014
    Posts
    70
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default Re: cannot find symbol:getSystemCpuLoad()

    ok

    import java.io.*;
    import java.util.*;
    import java.util.concurrent.TimeUnit;
    import com.sun.management.OperatingSystemMXBean;
    import java.lang.management.ManagementFactory;
    import java.lang.System;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
     
        public class sysinfoHooshi implements ActionListener{
        		class Info{			
    			public String name;
    			public String version;
    			public String arch;
    			public double ramUtil;
    			public double CPUUtil;
    		};
      ...  
    	public  void simulate()throws Exception{
     
    ...
     
    		Info[] queue = new Info[queueSize];
     
    		....
     
    		for(int i=0;i<queueSize;++i)
    		  queue[i]  = new Info();
     
     
    		for(int i=0;i<queueSize;++i)
    		{
    OperatingSystemMXBean osBean = (com.sun.management.OperatingSystemMXBean)
    			ManagementFactory.getOperatingSystemMXBean();
     	queue[pos].ramUtil =100-( osBean.getFreePhysicalMemorySize()/osBean.getTotalPhysicalMemorySize() ) * 100;		
    			queue[pos].CPUUtil = ( osBean.getSystemCpuLoad() ) * 100;
    		...
    			queue[pos].CPUUtil = ( osBean.getSystemCpuLoad() ) * 100;//ERROR
    			++pos;
    		}//end for  
    		....
     
    	}//end simulate()
     
    	public void showDialog()
    	{
    ...
    	}
    	 public void actionPerformed(ActionEvent e) {
              ...
    	}
     
    	public void showQueryDialog()
    	{
    ...
    	}
     
     
     
    	public static void main(String args[]) throws Exception{	
    ...
     
    	} // end main
       }// end class


    --- Update ---

    Quote Originally Posted by KevinWorkman View Post
    You need to post an MCVE that demonstrates exactly what you're doing. This works fine for me:

    import java.lang.management.ManagementFactory;
    import com.sun.management.OperatingSystemMXBean;
     
    public class Test {
    	public static void main (String [] args){
     
    		OperatingSystemMXBean osBean = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
     
    		double x = osBean.getSystemCpuLoad();
     
    		System.out.println(x);
     
    	}
    }

    Chances are you'll find your error in the process of creating the MCVE. Good luck.
    Please help me....What's wrong with my code? I don't understand

    --- Update ---

    I feel humiliated by my compiler.Help me please

    --- Update ---

    I guess the problem lies with my java version:
    This is what happen when I tried to get the java version
    ~$ java -version
    java version "1.6.0_31"
    OpenJDK Runtime Environment (IcedTea6 1.13.3) (6b31-1.13.3-1ubuntu1~0.12.04.2)
    OpenJDK Client VM (build 23.25-b01, mixed mode, sharing)
    The oracle document says that function is available since version 1,7 and, it seems my java version is 1.6
    Last edited by hooshdar3; July 17th, 2014 at 03:16 PM.

  8. #8
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,349
    My Mood
    Mellow
    Thanks
    254
    Thanked 785 Times in 770 Posts

    Default Re: cannot find symbol:getSystemCpuLoad()

    Solved then?

  9. #9
    Member
    Join Date
    Mar 2014
    Posts
    70
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default Re: cannot find symbol:getSystemCpuLoad()

    Quote Originally Posted by GregBrannon View Post
    Solved then?
    No, not yet.
    Don't know how to upgrade to see if the problem resolves

  10. #10
    Member
    Join Date
    Mar 2014
    Posts
    70
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default Empty dialog

    Hi.
    What is it that an empty dialog appears as the result of my code?
    my code:
    import java.lang.System;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
     
    public class t{
     
    	JDialog queryDialog = new  JDialog();	
        JCheckBox chkCPUUtil = new JCheckBox("CPU utilization");
        JCheckBox chkRAMUtil = new JCheckBox("RAM utilization");
        JCheckBox chkVersion = new JCheckBox("Version of the OS");
        JCheckBox chkArch = new JCheckBox("Processor architecture");
        JCheckBox chkName = new JCheckBox("Operating system name");
     
    	public void showQueryDialog()
    	{
    		queryDialog.setModal(true);
    		queryDialog.setSize(400, 150);
     
    		queryDialog.setTitle("Query dialog");
     
    		Container queryPane = queryDialog.getContentPane();
    		queryPane.setLayout(null);
    		queryDialog.add(chkName);
    		queryPane.add(chkVersion);
    		queryPane.add(chkArch);	
    		JButton queryButton = new JButton("OK");
    		queryPane.add(queryButton);
     
    	//	button.addActionListener(this);
    		queryButton.setBounds(90,90,30,10);
    		queryDialog.setVisible(true);
    	}
     
    	public static void main(String args[]) throws Exception{	
    	t o = new t();
    	o.showQueryDialog();
    	} // end main
    }

  11. #11
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    22,343
    Thanks
    56
    Thanked 2,376 Times in 2,346 Posts

    Default Re: Empty dialog

    What controls the positions of the components added to the dialog window?
    If you don't understand my answer, don't ignore it, ask a question.

  12. #12
    Member
    Join Date
    Mar 2014
    Posts
    70
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default Re: Empty dialog

    Quote Originally Posted by Norm View Post
    What controls the positions of the components added to the dialog window?
    Nothing.I have pasted all the code

  13. #13
    Member
    Join Date
    Mar 2014
    Posts
    70
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default Re: cannot find symbol:getSystemCpuLoad()

    I am still without solution

  14. #14
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,349
    My Mood
    Mellow
    Thanks
    254
    Thanked 785 Times in 770 Posts

    Default Re: Empty dialog

    Give your classes better names and respect Java's naming convention that calls for class names to begin with capital letters.

    Asking Norm's question differently (since you didn't get his point), Why are you using a null layout?

    Why are you adding components to the dialog and to its content pane?

    What are you using as a guide that is suggesting the techniques you've used in this code?

  15. #15
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,349
    My Mood
    Mellow
    Thanks
    254
    Thanked 785 Times in 770 Posts

    Default Re: cannot find symbol:getSystemCpuLoad()

    If you're comfortable doing so, download the latest 1.7 version of the JDK flavor of your choice and either replace the current 1.6 or add a new folder and stick 1.7 in it and then configure your IDE or editor to use the JDK 1.7 you just installed and compile to be compliant with 1.7.

    If you are not comfortable doing this, then perhaps you should ask in an L/Ubuntu forum how to do what I've described or to simply update your Java version.

  16. #16
    Member
    Join Date
    Mar 2014
    Posts
    70
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default Re: Empty dialog

    Quote Originally Posted by GregBrannon View Post

    Asking Norm's question differently (since you didn't get his point), Why are you using a null layout?
    I changed it to FlowLayout()
    Why are you adding components to the dialog and to its content pane?
    I am new to Java. I wastesting to discover the problem. I changed the pane type from Container to JFrame
    What are you using as a guide that is suggesting the techniques you've used in this code?
    It is just that My professor wanted me to write a java code, and he doesn't tell us what to do

  17. #17
    Junior Member
    Join Date
    Jul 2014
    Location
    Canada
    Posts
    25
    My Mood
    Bored
    Thanks
    0
    Thanked 5 Times in 4 Posts

    Default Re: Empty dialog

    Quote Originally Posted by hooshdar3 View Post
    It is just that My professor wanted me to write a java code, and he doesn't tell us what to do
    You're in university. The web is an open book, full to the brim with information, so I suggest you start by actually trying to learn rather than passing the buck like this. There are myriad tutorials and resources out there for you to look at, so start by finding one that addresses your issue. For example, from the comprehensive sun docs - How to Make Dialogs (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Swing Components).

  18. #18
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,349
    My Mood
    Mellow
    Thanks
    254
    Thanked 785 Times in 770 Posts

    Default Re: Empty dialog

    Post your updated code with corresponding questions.

    I asked for the sources of your inspirations, because there are a lot of bad examples on the 'net, possibly bad just because they're dated. Even if you're just trying different techniques, you probably saw examples of those techniques somewhere, and I was just wondering where. Not a big deal, but I suggest you use material provided by your professor or that has been written in the past 3 years or so. If you do need additional info, start with the Oracle Tutorials which have been mostly kept up to date.

  19. #19
    Member
    Join Date
    Mar 2014
    Posts
    70
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default JCheckBox

    Hello.

    Why is it that ticking JCheckBox objects make seamingly no effect in:
    import java.io.*;
    import java.util.*;
    import java.util.concurrent.TimeUnit;
    import com.sun.management.OperatingSystemMXBean;
    import java.lang.management.ManagementFactory;
    import java.lang.System;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.reflect.Method;
    import java.lang.reflect.Modifier;
     
        public class sysinfoHooshi /*implements ActionListener*/{
        /*		class Info{			
    			public String name;
    			public String version;
    			public String arch;
    			public double ramUtil;
    			public double CPUUtil;
    		};
        */
        JTextField  tf = new JTextField("");
        JTextField  tf2 = new JTextField("");
        JDialog dialog = new  JDialog();	
     
        /****************Query dialog variables*******************/
        JDialog queryDialog = new  JDialog();	
        JCheckBox chkCPUUtil = new JCheckBox("CPU utilization");
        JCheckBox chkRAMUtil = new JCheckBox("RAM utilization");
        JCheckBox chkVersion = new JCheckBox("Version of the OS");
        JCheckBox chkArch = new JCheckBox("Processor architecture");
        JCheckBox chkName = new JCheckBox("Operating system name");
        boolean nameChecked, versionChecked, archChecked, CPUChecked, RAMChecked;
        /*********************************************************/
     
    	public  void simulate()throws Exception{
    	...
    	}//end simulate()
     
    	public void showQueryDialog()
    	{
    		queryDialog.setModal(true);
    		queryDialog.setSize(400, 150);
     
    		queryDialog.setTitle("Query dialog");
     
    		JPanel queryPane = new  JPanel();
    		queryPane.setLayout(new FlowLayout());
    		queryPane.add(chkName);
    		queryPane.add(chkVersion);
    		queryPane.add(chkArch);	
    		JButton queryButton = new JButton("OK");
    		queryPane.add(queryButton);
    		queryDialog.add(queryPane);	
    		queryDialog.setVisible(true);
     
     
    				chkName.addItemListener (new ItemListener() {
    			public void itemStateChanged( ItemEvent e)
    			{nameChecked=e.getStateChange()==1 ? true : false;}
    		});
     
    		chkVersion.addItemListener (new ItemListener() {
    			public void itemStateChanged( ItemEvent e)
    			{ versionChecked=e.getStateChange()==ItemEvent.SELECTED ? true : false;}
    		});
     
    		chkArch.addItemListener (new ItemListener() {
    			public void itemStateChanged( ItemEvent e)
    			{ archChecked=e.getStateChange()==1 ? true : false;}
    		});
     
    		chkCPUUtil.addItemListener (new ItemListener() {
    			public void itemStateChanged( ItemEvent e)
    			{ CPUChecked=e.getStateChange()== 1 ? true :false;}
    		});
     
    		chkRAMUtil.addItemListener (new ItemListener() {
    			public void itemStateChanged( ItemEvent e)
    			{ RAMChecked = e.getStateChange()==1 ? true :false;}
    		});
     
    		queryButton.addActionListener(new ActionListener(){
    		public void actionPerformed( ActionEvent e )
    		   {
    			  System.out.println("Version selected:" + versionChecked);
    			  queryDialog.setVisible(false);
    		   }
    		}
    		);
    	}
     
    	public static void main(String args[]) throws Exception{	
    	sysinfoHooshi o = new sysinfoHooshi();
    	o.showQueryDialog();
     
    	} // end main
       }// end class
    ?Thanks in advance
    Last edited by hooshdar3; July 18th, 2014 at 09:22 AM.

  20. #20
    Member
    Join Date
    Mar 2014
    Posts
    70
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default Re: Empty dialog

    Quote Originally Posted by GregBrannon View Post
    Post your updated code with corresponding questions.

    I asked for the sources of your inspirations, because there are a lot of bad examples on the 'net, possibly bad just because they're dated. Even if you're just trying different techniques, you probably saw examples of those techniques somewhere, and I was just wondering where. Not a big deal, but I suggest you use material provided by your professor or that has been written in the past 3 years or so. If you do need additional info, start with the Oracle Tutorials which have been mostly kept up to date.
    What's the use of reading oracle tutorials when I must use openjdk?

    I will post my original code, OK.

    --- Update ---

    My original code
    import java.io.*;
    import java.util.*;
    import java.util.concurrent.TimeUnit;
    import com.sun.management.OperatingSystemMXBean;
    import java.lang.management.ManagementFactory;
    import java.lang.System;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.reflect.Method;
    import java.lang.reflect.Modifier;
     
        public class sysinfoHooshi implements ActionListener{
    		class Info{			
    			public String name;
    			public String version;
    			public String arch;
    			public double ramUtil;
    			public double CPUUtil;
    		};
     
        JTextField  tf = new JTextField("");
        JTextField  tf2 = new JTextField("");
        JDialog dialog = new  JDialog();	
     
        /****************Query dialog variables*******************/
        JDialog queryDialog = new  JDialog();	
        JCheckBox chkCPUUtil = new JCheckBox("CPU utilization");
        JCheckBox chkRAMUtil = new JCheckBox("RAM utilization");
        JCheckBox chkVersion = new JCheckBox("Version of the OS");
        JCheckBox chkArch = new JCheckBox("Processor architecture");
        JCheckBox chkName = new JCheckBox("Operating system name");
        boolean nameChecked, versionChecked, archChecked, CPUChecked, RAMChecked;
        /*********************************************************/
     
    	public  void simulate()throws Exception{
     
    	this.showDialog();
    		int simTime = Integer.parseInt( tf.getText() );;
    		int interval = Integer.parseInt( tf2.getText() );
     
     
    		int queueSize = 60*simTime/interval;
     
    		System.out.println( queueSize );
     
     
     
    		Info[] queue = new Info[queueSize];
     
    		int pos = 0;
     
    		for(int i=0;i<queueSize;++i)
    		  queue[i]  = new Info();
     
    		for(int i=0;i<queueSize;++i)
    		{
    			TimeUnit.SECONDS.sleep(interval);
    			OperatingSystemMXBean osBean = (com.sun.management.OperatingSystemMXBean)
    			ManagementFactory.getOperatingSystemMXBean();
    			queue[pos].name = System.getProperty("os.name");
    			queue[pos].version = System.getProperty("os.version");
    			queue[pos].arch = System.getProperty("os.arch");
    			queue[pos].ramUtil =100-( osBean.getFreePhysicalMemorySize()/osBean.getTotalPhysicalMemorySize() ) * 100;		
    			//queue[pos].CPUUtil= osBean.getSystemCpuLoad() ;
    			++pos;
    		}//end for  
    		showQueryDialog();
     
    	}//end simulate()
     
    	public void showDialog()
    	{
    		dialog.setModal(true);
    	dialog.setSize(400, 150);
     
    	dialog.setTitle("Input dialog");
     
    	Container pane = dialog.getContentPane();
    	pane.setLayout(null);
     
     
    	JLabel l1 = new JLabel("simtime(min)");
    	pane.add(l1);
    	l1.setBounds(10, 10, 100, 10);
     
     
    	pane.add( tf);
    	tf.setBounds(110,10, 40, 15);
     
    	JLabel l2 = new JLabel("interval(sec)") ;
    	pane.add(l2);
    	l2.setBounds(10, 50, 100, 10);
     
     
    	pane.add( tf2);
    	tf2.setBounds(110,50, 40, 15);
     
    	JButton button = new JButton("OK");
    	pane.add(button);
    	button.addActionListener(this);
    	button.setBounds(100,100,80,30);
    	dialog.setVisible(true);
    	}
    	 public void actionPerformed(ActionEvent e) {
    		 dialog.setVisible(false);
    	}
     
    	public void showQueryDialog()
    	{
    		queryDialog.setModal(true);
    		queryDialog.setSize(400, 150);
     
    		queryDialog.setTitle("Query dialog");
     
    		JPanel queryPane = new  JPanel();
    		queryPane.setLayout(new FlowLayout());
    		queryPane.add(chkName);
    		queryPane.add(chkVersion);
    		queryPane.add(chkArch);	
    		JButton queryButton = new JButton("OK");
    		queryPane.add(queryButton);
    		queryDialog.add(queryPane);	
    		queryDialog.setVisible(true);
     
     
    				chkName.addItemListener (new ItemListener() {
    			public void itemStateChanged( ItemEvent e)
    			{nameChecked=e.getStateChange()==1 ? true : false;}
    		});
     
    		chkVersion.addItemListener (new ItemListener() {
    			public void itemStateChanged( ItemEvent e)
    			{ versionChecked=e.getStateChange()==ItemEvent.SELECTED ? true : false;}
    		});
     
    		chkArch.addItemListener (new ItemListener() {
    			public void itemStateChanged( ItemEvent e)
    			{ archChecked=e.getStateChange()==1 ? true : false;}
    		});
     
    		chkCPUUtil.addItemListener (new ItemListener() {
    			public void itemStateChanged( ItemEvent e)
    			{ CPUChecked=e.getStateChange()== 1 ? true :false;}
    		});
     
    		chkRAMUtil.addItemListener (new ItemListener() {
    			public void itemStateChanged( ItemEvent e)
    			{ RAMChecked = e.getStateChange()==1 ? true :false;}
    		});
     
    		queryButton.addActionListener(new ActionListener(){
    		public void actionPerformed( ActionEvent e )
    		   {
    			  System.out.println("Version selected:" + versionChecked);
    			  queryDialog.setVisible(false);
    		   }
    		}
    		);
    	}
     
    	public void showResults(Info[] queue,int k)
    	{
     
    		String results = "";
    		for(int i =0;i<queue.length;++i)
    		{
    			if(nameChecked)
    		  results += "OS name:" + queue[i].name;
    		if(archChecked)
    		    results += "\nProcessor architecture: "+  queue[i].arch;
    		if(versionChecked)
    		    results += "\nOS version" + queue[i].version; 
     
    		results += "\n---------------------------";
     
    		}//end for
    	}
     
    	public static void main(String args[]) throws Exception{	
    	sysinfoHooshi o = new sysinfoHooshi();
    	o.showQueryDialog();
     
    	} // end main
       }// end class

  21. #21
    Junior Member
    Join Date
    Jul 2014
    Location
    Canada
    Posts
    25
    My Mood
    Bored
    Thanks
    0
    Thanked 5 Times in 4 Posts

    Default Re: Empty dialog

    Quote Originally Posted by hooshdar3 View Post
    What's the use of reading oracle tutorials when I must use openjdk?
    I don't really understand your point. Read the tutorials, and if there is a point at which functionality differs tangibly, find an OJDK reference for that specific functionality.

    Your code seems to run fine for me in eclipse except for the results, but that wasn't the question. By the way, I'm using the Sun/Oracle JDK, so I would argue that your point is further invalidated.

  22. #22
    Junior Member
    Join Date
    Jul 2014
    Location
    Canada
    Posts
    25
    My Mood
    Bored
    Thanks
    0
    Thanked 5 Times in 4 Posts

    Default Re: JCheckBox

    I feel as though this thread should be merged with your previous question.

    EDIT: You've posted 5 questions about this program in the past 24 hours... Do you do any of your own work?

  23. The Following 2 Users Say Thank You to DuncanS For This Useful Post:

    GregBrannon (July 18th, 2014), hooshdar3 (July 18th, 2014)

  24. #23
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,349
    My Mood
    Mellow
    Thanks
    254
    Thanked 785 Times in 770 Posts

    Default Re: Empty dialog

    What's the use of reading oracle tutorials when I must use openjdk?
    You have some odd notions and practices that indicate you've made little to no effort to really understand what you're doing, the tools you're using, or what Java is. Please, take a step back from programming and do some studying.

    --- Update ---

    Multiple threads merged.

    Please quit starting new threads on essentially the same topic. You've posted these and other threads trying to understand how to write action listeners, and I'm not convinced you've made any progress. Please review the advice you've been given and write a few study programs that include action listeners. Work on those until they perform as desired.

  25. #24
    Member
    Join Date
    Mar 2014
    Posts
    70
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default Re: Empty dialog

    Quote Originally Posted by GregBrannon View Post
    You have some odd notions and practices that indicate you've made little to no effort to really understand what you're doing, the tools you're using, or what Java is. Please, take a step back from programming and do some studying.
    I have studied some examples, but believe me or not, I have no teacher. Never had any teacher.


    --- Update ---

    Multiple threads merged.

    Please quit starting new threads on essentially the same topic. You've posted these and other threads trying to understand how to write action listeners, and I'm not convinced you've made any progress. Please review the advice you've been given and write a few study programs that include action listeners. Work on those until they perform as desired.
    They each work , but the problem is that I have 2 dialogs, each with one button.

  26. #25
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,349
    My Mood
    Mellow
    Thanks
    254
    Thanked 785 Times in 770 Posts

    Default Re: cannot find symbol:getSystemCpuLoad()

    I have studied some examples, but believe me or not, I have no teacher. Never had any teacher.
    You mentioned a professor earlier, and someone/something is requiring you to use OpenJDK. If you and your professor aren't connecting, then all the more reason to STUDY.

    They each work , but the problem is that I have 2 dialogs, each with one button.
    That's not a problem.

    Post runnable code IN THIS THREAD that creates 2 dialogs, each with its own button, describe what is supposed to be happening (comments in your code would be helpful), what is happening instead, and specific questions that will help you make progress.

Page 1 of 2 12 LastLast

Similar Threads

  1. cannot find symbol
    By lungelo in forum What's Wrong With My Code?
    Replies: 3
    Last Post: September 15th, 2013, 06:06 AM
  2. [SOLVED] Cannot Find Symbol
    By ChicoTheMan94 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: September 25th, 2012, 03:46 PM
  3. Cannot find symbol
    By BadgerWatch in forum What's Wrong With My Code?
    Replies: 4
    Last Post: November 6th, 2011, 11:25 PM
  4. Cannot find Symbol?
    By defmetalhead in forum What's Wrong With My Code?
    Replies: 8
    Last Post: July 5th, 2011, 09:48 AM
  5. Cannot find symbol?
    By stealthmonkey in forum What's Wrong With My Code?
    Replies: 3
    Last Post: December 10th, 2010, 10:02 PM