- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在将从“listallButton”检索到的数据正确显示到 JTable 中时遇到问题。数据库正在将SELECT * FROM ATM
信息作为一组字符串正确发送。我不确定它是否被正确接收和记录,因为 JTables 没有显示任何数据并且出现空指针异常:
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.table.*;
import java.util.*;
import javax.swing.table.AbstractTableModel;
public class AtmView extends JApplet implements ActionListener{
final static String banner = "WELCOME TO SHETH BANK!";
JLabel bannerLabel;
Border blackline;
CardLayout myLayout;
JPanel screensPanel; //main center panel
JPanel loginPanel; //login panel
JButton loginButton; //login button
JTextField accountNumber; //login account number field
JPasswordField password; //login password/PIN field
String access_lvl; //login access level
public String account;
String pass;
DataObject communicationObject;
final static String LOGIN = "LOGIN";
JPanel empPanel; //employee panel
CardLayout empLayout; //employee center panel
JButton createacctButton; //employee create account button
JButton listallButton; //employee list all accounts button
JPanel empcenterPanel;
final static String EMP1 = "EMPLOYEE";
String balance;
String withdrawal_amount;
String withdraw_amount;
JLabel balanceDisplay;
final static String LIST = "listallPanel";
JPanel listallPanel;
JTable table;
String[] data;
String[][] data2;
String[] temp;
String row;
DefaultTableModel tbm;
JLabel listdisplay;
String acclist;
ArrayList<String> al;
JButton empBackButton; //emp back
JButton emplogoutButton; //emp logout
JButton empwithdrawButton;
JPanel custPanel; //customer panel
final static String CUST = "CUSTOMER";
JButton checkbalButton; //check balance
JButton withdrawButton; //withdraw
JButton depositButton; //deposit
JButton transferButton; //transfer
JLabel display; //server response display area
@Override
public void init(){
getContentPane().setVisible(true);
getContentPane().setLayout(new BorderLayout());
getContentPane().setBackground(Color.BLUE);
//getContentPane().setBorder(blackline);
bannerLabel = new JLabel(banner,JLabel.CENTER);
bannerLabel.setVerticalTextPosition(JLabel.CENTER);
bannerLabel.setHorizontalTextPosition(JLabel.CENTER);
bannerLabel.setFont(new Font("Serif", Font.BOLD, 26));
bannerLabel.setForeground(Color.yellow);
blackline = BorderFactory.createLineBorder(Color.black);
//bannerLabel.setBorder(blackline);
add(bannerLabel, BorderLayout.NORTH);
//bannerLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 2, 0, Color.BLACK));
myLayout = new CardLayout();
screensPanel = new JPanel();
screensPanel.setLayout(myLayout);
add(screensPanel, BorderLayout.CENTER);
//================ LOGIN VIEW ==================================
loginPanel = new JPanel(new GridLayout(3,1));
loginPanel.setBackground(Color.BLUE);
JLabel loginTitle = new JLabel("ENTER LOGIN INFO", JLabel.CENTER);
//loginTitle.setVerticalAlignment(SwingConstants.TOP);
loginTitle.setFont(new Font("Serif", Font.BOLD, 20));
loginTitle.setForeground(Color.yellow);
loginPanel.add(loginTitle);
JPanel accountInfo = new JPanel(new GridLayout(2,1));
accountInfo.setBackground(Color.blue);
JPanel accNum = new JPanel();
accNum.setBackground(Color.BLUE);
JLabel accLabel = new JLabel("Account Number: ", JLabel.CENTER);
accLabel.setFont(new Font("Serif", Font.BOLD, 14));
accLabel.setForeground(Color.yellow);
accountNumber = new JTextField(4);
accountNumber.setHorizontalAlignment(JTextField.CENTER);
accNum.add(accLabel);
accLabel.setLabelFor(accountNumber);
accNum.add(accountNumber);
accountInfo.add(accNum);
JPanel pw = new JPanel();
pw.setBackground(Color.BLUE);
JLabel pwLabel = new JLabel("Password/PIN: ", JLabel.CENTER);
pwLabel.setFont(new Font("Serif", Font.BOLD, 14));
pwLabel.setForeground(Color.yellow);
password = new JPasswordField(4);
password.setHorizontalAlignment(JTextField.CENTER);
pw.add(pwLabel);
pwLabel.setLabelFor(password);
pw.add(password);
accountInfo.add(pw);
loginPanel.add(accountInfo);
JPanel logBut = new JPanel();
loginButton = new JButton("Login");
loginButton.addActionListener(this);
logBut.setBackground(Color.blue);
logBut.add(loginButton);
loginPanel.add(logBut);
screensPanel.add(loginPanel, "LOGIN");
//================ EMPLOYEE VIEW ==================================
empPanel = new JPanel(new BorderLayout());
empPanel.setBackground(Color.BLUE);
JLabel empLabel = new JLabel("Employee View",JLabel.CENTER);
empLabel.setVerticalTextPosition(JLabel.CENTER);
empLabel.setHorizontalTextPosition(JLabel.CENTER);
empLabel.setFont(new Font("Serif", Font.BOLD, 20));
empLabel.setForeground(Color.yellow);
empPanel.add(empLabel, BorderLayout.NORTH);
empLayout = new CardLayout();
empcenterPanel = new JPanel();
empcenterPanel.setBackground(Color.blue);
empcenterPanel.setLayout(empLayout);
empPanel.add(empcenterPanel, BorderLayout.CENTER);
JPanel empbuttonPanel = new JPanel(new GridLayout(3,2));
empbuttonPanel.setBackground(Color.blue);
checkbalButton = new JButton("Check Balance");
checkbalButton.addActionListener(this);
empbuttonPanel.add(checkbalButton);
withdrawButton = new JButton("Withdraw");
withdrawButton.addActionListener(this);
empbuttonPanel.add(withdrawButton);
depositButton = new JButton("Deposit");
depositButton.addActionListener(this);
empbuttonPanel.add(depositButton);
transferButton = new JButton("Transfer");
transferButton.addActionListener(this);
empbuttonPanel.add(transferButton);
createacctButton = new JButton("Create account");
createacctButton.addActionListener(this);
empbuttonPanel.add(createacctButton);
listallButton = new JButton("List all accounts");
listallButton.addActionListener(this);
empbuttonPanel.add(listallButton);
empcenterPanel.add(empbuttonPanel, "EmpButtonPanel");
createPanel = new JPanel(new GridLayout(6,1));
createPanel.setBackground(Color.blue);
JLabel createTitle = new JLabel("Enter new account info: ",JLabel.CENTER);
createTitle.setVerticalTextPosition(JLabel.CENTER);
createTitle.setHorizontalTextPosition(JLabel.CENTER);
createTitle.setFont(new Font("Serif", Font.BOLD, 18));
createTitle.setForeground(Color.yellow);
createPanel.add(createTitle);
JPanel cloginPanel = new JPanel(new FlowLayout());
cloginPanel.setBackground(Color.blue);
JLabel cloginLabel = new JLabel("Account number: ",JLabel.CENTER);
cloginLabel.setVerticalTextPosition(JLabel.CENTER);
cloginLabel.setHorizontalTextPosition(JLabel.CENTER);
cloginLabel.setFont(new Font("Serif", Font.BOLD, 14));
cloginLabel.setForeground(Color.yellow);
cloginPanel.add(cloginLabel);
createloginField = new JTextField(4);
createloginField.setHorizontalAlignment(JTextField.CENTER);
cloginLabel.setLabelFor(createloginField);
cloginPanel.add(createloginField);
createPanel.add(cloginPanel);
JPanel cpinPanel = new JPanel(new FlowLayout());
cpinPanel.setBackground(Color.blue);
JLabel cpinLabel = new JLabel("PIN: ",JLabel.CENTER);
cpinLabel.setVerticalTextPosition(JLabel.CENTER);
cpinLabel.setHorizontalTextPosition(JLabel.CENTER);
cpinLabel.setFont(new Font("Serif", Font.BOLD, 14));
cpinLabel.setForeground(Color.yellow);
cpinPanel.add(cpinLabel);
createpinField = new JTextField(4);
createpinField.setHorizontalAlignment(JTextField.CENTER);
cloginLabel.setLabelFor(createpinField);
cpinPanel.add(createpinField);
createPanel.add(cpinPanel);
JPanel cbalPanel = new JPanel(new FlowLayout());
cbalPanel.setBackground(Color.blue);
JLabel cbalLabel = new JLabel("Starting balance: ",JLabel.CENTER);
cbalLabel.setVerticalTextPosition(JLabel.CENTER);
cbalLabel.setHorizontalTextPosition(JLabel.CENTER);
cbalLabel.setFont(new Font("Serif", Font.BOLD, 14));
cbalLabel.setForeground(Color.yellow);
cbalPanel.add(cbalLabel);
createbalanceField = new JTextField(10);
createbalanceField.setHorizontalAlignment(JTextField.CENTER);
cbalLabel.setLabelFor(createbalanceField);
cbalPanel.add(createbalanceField);
createPanel.add(cbalPanel);
JPanel clvlPanel = new JPanel(new FlowLayout());
clvlPanel.setBackground(Color.blue);
JLabel clvlLabel = new JLabel("Access level (1 for Employee, 2 for Customer): ",JLabel.CENTER);
clvlLabel.setVerticalTextPosition(JLabel.CENTER);
clvlLabel.setHorizontalTextPosition(JLabel.CENTER);
clvlLabel.setFont(new Font("Serif", Font.BOLD, 14));
clvlLabel.setForeground(Color.yellow);
clvlPanel.add(clvlLabel);
createlvlField = new JTextField(1);
createlvlField.setHorizontalAlignment(JTextField.CENTER);
cbalLabel.setLabelFor(createlvlField);
clvlPanel.add(createlvlField);
createPanel.add(clvlPanel);
JPanel createbutPanel = new JPanel();
createbutPanel.setBackground(Color.blue);
createButton = new JButton("Create");
createButton.addActionListener(this);
createbutPanel.add(createButton);
createPanel.add(createbutPanel);
empcenterPanel.add(createPanel, "createPanel");
listallPanel = new JPanel(new BorderLayout());
listallPanel.setBackground(Color.blue);
JLabel listTitle = new JLabel("All accounts in system: ",JLabel.CENTER);
listTitle.setVerticalTextPosition(JLabel.CENTER);
listTitle.setHorizontalTextPosition(JLabel.CENTER);
listTitle.setFont(new Font("Serif", Font.BOLD, 16));
listTitle.setForeground(Color.yellow);
listallPanel.add(listTitle,BorderLayout.NORTH);
String[] columnNames = {"Account Number","PIN","Access Level","Balance",};
String [][] rowTest = {{"1111","1111","1","1000",},{"1111","1111","1","1000",}};
String delimiter = ",";
tbm = new DefaultTableModel();
tbm.addColumn("Account Number");
tbm.addColumn("PIN");
tbm.addColumn("Access Level");
tbm.addColumn("Balance");
table = new JTable(tbm);
JScrollPane scrollPane = new JScrollPane(table);
listallPanel.add(scrollPane,BorderLayout.CENTER);
empcenterPanel.add(listallPanel, "listallPanel");
JPanel logoutPanel = new JPanel(new FlowLayout());
emplogoutButton = new JButton("Logout");
emplogoutButton.addActionListener(this);
empBackButton = new JButton("Back");
empBackButton.addActionListener(this);
logoutPanel.setBackground(Color.blue);
logoutPanel.add(emplogoutButton);
logoutPanel.add(empBackButton);
empPanel.add(logoutPanel, BorderLayout.SOUTH);
screensPanel.add(empPanel, "EMPLOYEE");
//================ CUSTOMER VIEW ==================================
}
public void actionPerformed(ActionEvent event) {
if (event.getSource() == loginButton) {
account = accountNumber.getText();
pass = password.getText();
String query = "SELECT access_level FROM ATM a WHERE a.account_number='"+account+"' AND a.pin='"+pass+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
access_lvl = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
if ((access_lvl.charAt(0)) == '1') {
myLayout.show(screensPanel, EMP1);
empLayout.first(empcenterPanel);}
else {myLayout.show(screensPanel, CUST); } }
else if(event.getSource() == emplogoutButton) {
accountNumber.setText("");
password.setText("");
account = "";
pass = "";
empLayout.first(empcenterPanel);
myLayout.show(screensPanel, LOGIN);
doLayout();}
else if(event.getSource() == checkbalButton) {
String query = "SELECT balance FROM ATM a WHERE a.account_number='"+account+"' AND a.pin='"+pass+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
balanceDisplay.setText(balance);
//balanceDisplayPanel.add(balanceDisplay);
//checkBalancePanel.add(balanceDisplayPanel);
empLayout.show(empcenterPanel, EMPBAL); }
else if(event.getSource() == empBackButton) {
empLayout.first(empcenterPanel); }
else if(event.getSource() == withdrawButton) {
empLayout.show(empcenterPanel, EMPWITH); }
else if(event.getSource() == empwithdrawButton) {
withdraw_amount = withdrawField.getText();
Integer w_amt = Integer.valueOf(withdraw_amount);
String query = "SELECT balance FROM ATM a WHERE a.account_number='"+account+"' AND a.pin='"+pass+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
Integer oldbalance = Integer.valueOf(balance);
Integer newbalanceamount = oldbalance - w_amt;
balance2 = "" + newbalanceamount;
String query2 = "UPDATE ATM SET balance='"+balance2+"' WHERE account_number='"+account+"' AND pin='"+pass+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query2);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
//balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e); }
withdrawField.setText("");
empLayout.first(empcenterPanel); }
else if(event.getSource() == depositButton) {
empLayout.show(empcenterPanel, EMPDEP); }
else if(event.getSource() == empdepositButton) {
deposit_amount = depositField.getText();
Integer d_amt = Integer.valueOf(deposit_amount);
String query = "SELECT balance FROM ATM a WHERE a.account_number='"+account+"' AND a.pin='"+pass+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
Integer oldbalance2 = Integer.valueOf(balance);
Integer newbalanceamount2 = oldbalance2 + d_amt;
balance3 = "" + newbalanceamount2;
String query2 = "UPDATE ATM SET balance='"+balance3+"' WHERE account_number='"+account+"' AND pin='"+pass+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query2);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
//balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
depositField.setText("");
empLayout.first(empcenterPanel); }
else if(event.getSource() == transferButton) {
empLayout.show(empcenterPanel, EMPTNS); }
else if(event.getSource() == transferamountButton) {
fromAccount = fromField.getText();
toAccount = toField.getText();
transAmount = transferAmount.getText();
Integer t_amt = Integer.valueOf(transAmount);
String query = "SELECT balance FROM ATM a WHERE a.account_number='"+fromAccount+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
Integer fromBalance = Integer.valueOf(balance);
String query2 = "SELECT balance FROM ATM a WHERE a.account_number='"+toAccount+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query2);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
Integer toBalance = Integer.valueOf(balance);
Integer newFromBalance = fromBalance - t_amt;
Integer newToBalance = toBalance + t_amt;
String newFBalance = "" + newFromBalance;
String newTBalance = "" + newToBalance;
String query3 = "UPDATE ATM SET balance='"+newFBalance+"' WHERE account_number='"+fromAccount+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query3);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
//balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
String query4 = "UPDATE ATM SET balance='"+newTBalance+"' WHERE account_number='"+toAccount+"'";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query4);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
//balance = communicationObject.getMessage();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
toField.setText("");
fromField.setText("");
transferAmount.setText("");
empLayout.first(empcenterPanel); }
else if(event.getSource() == createacctButton) {
empLayout.show(empcenterPanel, CREATE); }
else if(event.getSource() == createButton) {
createLogin = createloginField.getText();
createPin = createpinField.getText();
createLvl = createlvlField.getText();
createBalance = createbalanceField.getText();
String query = "INSERT INTO ATM VALUES ("+createLogin+","+createPin+","+createLvl+","+createBalance+")";
try {
communicationObject = new DataObject();
communicationObject.setMessage(query);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
createloginField.setText("");
createpinField.setText("");
createlvlField.setText("");
createbalanceField.setText("");
empLayout.first(empcenterPanel); }
else if(event.getSource() == listallButton) {
String query = "SELECT * FROM ATM";
String delimiter = ",";
String input = "go";
int count=0;
al = new ArrayList<String>();
try {
communicationObject = new DataObject();
communicationObject.setMessage(query);
Socket socketToServer = new Socket("sunlab32.njit.edu",31414);
ObjectOutputStream myOutputStream = new ObjectOutputStream(socketToServer.getOutputStream());
ObjectInputStream myInputStream = new ObjectInputStream(socketToServer.getInputStream());
myOutputStream.writeObject(communicationObject);
communicationObject = (DataObject)myInputStream.readObject();
input = communicationObject.getMessage();
if (input != "stop") {
al.add(input);
data[count] = input;
count++; }
for (int i=0;i<data.length;i++) {
row = data[i];
temp = row.split(delimiter);
tbm.addRow(new String[] {temp[0],temp[1],temp[2],temp[3]}); }
table.setModel(tbm);
table.repaint();
//Object Object_Array[]=al.toArray();
//data=new String[Object_Array.length];
//for (int i=0;i<data.length;i++) {data[i]=Object_Array[i].toString();}
myOutputStream.close();
myInputStream.close();
socketToServer.close(); }
catch(Exception e){System.out.println(e);}
empLayout.show(empcenterPanel, LIST); }
} }
堆栈跟踪:
java.lang.NullPointerException at AtmView.actionPerformed(AtmView.java:757) at
javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at
javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at
javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at
javax.swing.DefaultButtonModel.setPressed(Unknown Source) at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at
java.awt.Component.processMouseEvent(Unknown Source) at
javax.swing.JComponent.processMouseEvent(Unknown Source) at
//...
java.awt.EventQueue.dispatchEventImpl(Unknown Source) at
java.awt.EventQueue.access$000(Unknown Source) at
java.awt.EventQueue$3.run(Unknown Source) at
java.awt.EventQueue$3.run(Unknown Source) at
最佳答案
空点异常可能是由数据库中的某些空列引起的。你的做法不好,如果数据库中有大量记录的话会让你的程序崩溃,更好的方法是使用分页来避免加载大量记录。
关于从 Oracle DB 加载 Java JTable 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10398221/
初学者 android 问题。好的,我已经成功写入文件。例如。 //获取文件名 String filename = getResources().getString(R.string.filename
我已经将相同的图像保存到/data/data/mypackage/img/中,现在我想显示这个全屏,我曾尝试使用 ACTION_VIEW 来显示 android 标准程序,但它不是从/data/dat
我正在使用Xcode 9,Swift 4。 我正在尝试使用以下代码从URL在ImageView中显示图像: func getImageFromUrl(sourceUrl: String) -> UII
我的 Ubuntu 安装 genymotion 有问题。主要是我无法调试我的数据库,因为通过 eclipse 中的 DBMS 和 shell 中的 adb 我无法查看/data/文件夹的内容。没有显示
我正在尝试用 PHP 发布一些 JSON 数据。但是出了点问题。 这是我的 html -- {% for x in sets %}
我观察到两种方法的结果不同。为什么是这样?我知道 lm 上发生了什么,但无法弄清楚 tslm 上发生了什么。 > library(forecast) > set.seed(2) > tts lm(t
我不确定为什么会这样!我有一个由 spring data elasticsearch 和 spring data jpa 使用的类,但是当我尝试运行我的应用程序时出现错误。 Error creatin
在 this vega 图表,如果我下载并转换 flare-dependencies.json使用以下 jq 到 csv命令, jq -r '(map(keys) | add | unique) as
我正在提交一个项目,我必须在其中创建一个带有表的 mysql 数据库。一切都在我这边进行,所以我只想检查如何将我所有的压缩文件发送给使用不同计算机的人。基本上,我如何为另一台计算机创建我的数据库文件,
我有一个应用程序可以将文本文件写入内部存储。我想仔细看看我的电脑。 我运行了 Toast.makeText 来显示路径,它说:/数据/数据/我的包 但是当我转到 Android Studio 的 An
我喜欢使用 Genymotion 模拟器以如此出色的速度加载 Android。它有非常好的速度,但仍然有一些不稳定的性能。 如何从 Eclipse 中的文件资源管理器访问 Genymotion 模拟器
我需要更改 Silverlight 中文本框的格式。数据通过 MVVM 绑定(bind)。 例如,有一个 int 属性,我将 1 添加到 setter 中的值并调用 OnPropertyChanged
我想向 Youtube Data API 提出请求,但我不需要访问任何用户信息。我只想浏览公共(public)视频并根据搜索词显示视频。 我可以在未经授权的情况下这样做吗? 最佳答案 YouTube
我已经设置了一个 Twilio 应用程序,我想向人们发送更新,但我不想回复单个文本。我只是想让他们在有问题时打电话。我一切正常,但我想在发送文本时显示传入文本,以确保我不会错过任何问题。我正在使用 p
我有一个带有表单的网站(目前它是纯 HTML,但我们正在切换到 JQuery)。流程是这样的: 接受用户的输入 --- 5 个整数 通过 REST 调用网络服务 在服务器端运行一些计算...并生成一个
假设我们有一个名为 configuration.js 的文件,当我们查看内部时,我们会看到: 'use strict'; var profile = { "project": "%Projec
这部分是对 Previous Question 的扩展我的: 我现在可以从我的 CI Controller 成功返回 JSON 数据,它返回: {"results":[{"id":"1","Sourc
有什么有效的方法可以删除 ios 中 CBL 的所有文档存储?我对此有疑问,或者,如果有人知道如何从本质上使该应用程序像刚刚安装一样,那也会非常有帮助。我们正在努力确保我们的注销实际上将应用程序设置为
我有一个 Rails 应用程序,它与其他 Rails 应用程序通信以进行数据插入。我使用 jQuery $.post 方法进行数据插入。对于插入,我的其他 Rails 应用程序显示 200 OK。但在
我正在为服务于发布请求的 API 调用运行单元测试。我正在传递请求正文,并且必须将响应作为帐户数据返回。但我只收到断言错误 注意:数据是从 Azure 中获取的 spec.js const accou
我是一名优秀的程序员,十分优秀!