我一直试图解决这个问题,我已经在不同的程序中运行它,所以它肯定在代码中.可能也很简单.错误说
Password2.java:90:错误:找不到符号if(pw.equals(password))^符号:变量密码位置:class Password2.EnterButtonHandler 1错误
这是代码:
// Password1.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Password2 extends JFrame // inherits from the JFrame class
{
// static final variables to hold frame dimensions (in pixels)
private static final int WIDTH = 400;
private static final int HEIGHT = 120;
//declare labels, fields, buttons, etc.
private JLabel enterLabel, validLabel, resultLabel;
private JTextField pwTextField;
private JButton enterB, clearB;
private EnterButtonHandler ebHandler;
private ClearButtonHandler cbHandler;
public Password2() // constructor defines frame …Run Code Online (Sandbox Code Playgroud) 我的最终目标是安装当前版本的Ruby on Rails.我在OS X Mountain Lion上运行.到目前为止,这是我的流程:
已安装的RVM
$ \curl -L https://get.rvm.io | bash -s stable
Run Code Online (Sandbox Code Playgroud)
检查已知(并且我认为已批准)安装
$ rvm list known
Run Code Online (Sandbox Code Playgroud)
我看到目前稳定的版本可用
[ruby-]2.0.0[-p247]
Run Code Online (Sandbox Code Playgroud)
键入安装命令
$ rvm install 2.0.0-p247
Run Code Online (Sandbox Code Playgroud)
注意:我也尝试过这些安装命令
$ rvm install ruby-2.0.0-p247
$ rvm install ruby=2.0.0-p247
Run Code Online (Sandbox Code Playgroud)
我无处可去.结果:
$ rvm install 2.0.0-p247
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-2.0.0-p247.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Certificates …Run Code Online (Sandbox Code Playgroud) 我试图通过这样的数组创建一个列表:
private Application[] GetApps()
{
DataSet ds = new Dataset();
string query = "query";
ds = GetData(query);
var appList = new Application[ds.Tables[0].Rows.Count];
for(var i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
{
DataRow item = ds.Tables[0].Rows[i];
appList[i].Name = item["Name"].ToString();
appList[i].Confidentiality = int.Parse(item["Conf"].ToString());
appList[i].Id = item["ID"].ToString();
}
return appList;
}
Run Code Online (Sandbox Code Playgroud)
我一直得到一个对象null错误,我知道我必须遗漏一些完全明显的东西,我只是没有看到.我是否需要以其他方式声明新数组?