首页上一页 1 下一页尾页 7 条记录 1/1页
java开发实例中的问题
发表在Java图书答疑
2011-11-06
是否精华
是
否
版块置顶:
是
否
设置时间:
非永久
永久
起始时间:
结束时间:
是否扣分:
是
否
课本说 用sql2000 我用的是sql2005 数据库连接不上 [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.应该怎么解决
精彩评论 7
2011-11-06
沙发
private JButton createFrameButton(String fName, String cname) {
String imgUrl = "res/ActionIcon/" + fName + ".png";
String imgUrl_roll = "res/ActionIcon/" + fName + "_roll.png";
String imgUrl_down = "res/ActionIcon/" + fName + "_down.png";
Icon icon = new ImageIcon(imgUrl);
Icon icon_roll = null;
if (imgUrl_roll != null)
icon_roll = new ImageIcon(imgUrl_roll);
Icon icon_down = null;
if (imgUrl_down != null)
icon_down = new ImageIcon(imgUrl_down);
Action action = new openFrameAction(fName, cname, icon);
JButton button = new JButton(action);
button.setMargin(new Insets(0, 0, 0, 0));
[font color=#FF0000]button.setHideActionText(true);
[/font]
这句报错 the method setHideActionText is undifined for the type button
String imgUrl = "res/ActionIcon/" + fName + ".png";
String imgUrl_roll = "res/ActionIcon/" + fName + "_roll.png";
String imgUrl_down = "res/ActionIcon/" + fName + "_down.png";
Icon icon = new ImageIcon(imgUrl);
Icon icon_roll = null;
if (imgUrl_roll != null)
icon_roll = new ImageIcon(imgUrl_roll);
Icon icon_down = null;
if (imgUrl_down != null)
icon_down = new ImageIcon(imgUrl_down);
Action action = new openFrameAction(fName, cname, icon);
JButton button = new JButton(action);
button.setMargin(new Insets(0, 0, 0, 0));
[font color=#FF0000]button.setHideActionText(true);
[/font]
这句报错 the method setHideActionText is undifined for the type button
2011-11-06
板凳
public static boolean insertRukuInfo(TbRukuMain ruMain) {
try {
boolean autoCommit = conn.getAutoCommit();
conn.setAutoCommit(false);
// 添加入库主表记录
insert("insert into tb_ruku_main values('" + ruMain.getRkId()
+ "','" + ruMain.getPzs() + "'," + ruMain.getJe() + ",'"
+ ruMain.getYsjl() + "','" + ruMain.getGysname() + "','"
+ ruMain.getRkdate() + "','" + ruMain.getCzy() + "','"
+ ruMain.getJsr() + "','" + ruMain.getJsfs() + "')");
Set<TbRukuDetail> rkDetails = ruMain.getTabRukuDetails();
for (Iterator<TbRukuDetail> iter = rkDetails.iterator(); iter
.hasNext();) {
TbRukuDetail details = iter.next();
// 添加入库详细表记录
insert("insert into tb_ruku_detail values('" + ruMain.getRkId()
+ "','" + details.getTabSpinfo() + "',"
+ details.getDj() + "," + details.getSl() + ")");
// 添加或修改库存表记录
Item item = new Item();
item.setId(details.getTabSpinfo());
TbSpinfo spInfo = getSpInfo(item);[font color=#FF0000]
if (spInfo.getId() != null && !spInfo.getId().isEmpty()) {
[/font] TbKucun kucun = getKucun(item);
if (kucun.getId() == null || kucun.getId().isEmpty()) {
the method isEmpty is undefined for the type string 这具体怎么改呢 老师 新手求教啊
try {
boolean autoCommit = conn.getAutoCommit();
conn.setAutoCommit(false);
// 添加入库主表记录
insert("insert into tb_ruku_main values('" + ruMain.getRkId()
+ "','" + ruMain.getPzs() + "'," + ruMain.getJe() + ",'"
+ ruMain.getYsjl() + "','" + ruMain.getGysname() + "','"
+ ruMain.getRkdate() + "','" + ruMain.getCzy() + "','"
+ ruMain.getJsr() + "','" + ruMain.getJsfs() + "')");
Set<TbRukuDetail> rkDetails = ruMain.getTabRukuDetails();
for (Iterator<TbRukuDetail> iter = rkDetails.iterator(); iter
.hasNext();) {
TbRukuDetail details = iter.next();
// 添加入库详细表记录
insert("insert into tb_ruku_detail values('" + ruMain.getRkId()
+ "','" + details.getTabSpinfo() + "',"
+ details.getDj() + "," + details.getSl() + ")");
// 添加或修改库存表记录
Item item = new Item();
item.setId(details.getTabSpinfo());
TbSpinfo spInfo = getSpInfo(item);[font color=#FF0000]
if (spInfo.getId() != null && !spInfo.getId().isEmpty()) {
[/font] TbKucun kucun = getKucun(item);
if (kucun.getId() == null || kucun.getId().isEmpty()) {
the method isEmpty is undefined for the type string 这具体怎么改呢 老师 新手求教啊
2011-11-09
4L
[FIELDSET][LEGEND]引自:1楼[/LEGEND]
private JButton createFrameButton(String fName, String cname) {
String imgUrl = "res/ActionIcon/" + fName + ".png";
String imgUrl_roll = "res/ActionIcon/" + fName + "_roll.png";
String imgUrl_down = "res/ActionIcon/" + fName + "_down.png";
Icon icon = new ImageIcon(imgUrl);
Icon icon_roll = null;
if (imgUrl_roll != null)
icon_roll = new ImageIcon(imgUrl_roll);
Icon icon_down = null;
if (imgUrl_down != null)
icon_down = new ImageIcon(imgUrl_down);
Action action = new openFrameAction(fName, cname, icon);
JButton button = new JButton(action);
button.setMargin(new Insets(0, 0, 0, 0));
[font color=#FF0000]button.setHideActionText(true);
[/font]
这句报错 the method setHideActionText is undifined for the type button
[/FIELDSET]
回复:JButton类可能不支持setHideActionText方法,虽然它继承了AbstractButton。请问你想用这个方法干啥?
private JButton createFrameButton(String fName, String cname) {
String imgUrl = "res/ActionIcon/" + fName + ".png";
String imgUrl_roll = "res/ActionIcon/" + fName + "_roll.png";
String imgUrl_down = "res/ActionIcon/" + fName + "_down.png";
Icon icon = new ImageIcon(imgUrl);
Icon icon_roll = null;
if (imgUrl_roll != null)
icon_roll = new ImageIcon(imgUrl_roll);
Icon icon_down = null;
if (imgUrl_down != null)
icon_down = new ImageIcon(imgUrl_down);
Action action = new openFrameAction(fName, cname, icon);
JButton button = new JButton(action);
button.setMargin(new Insets(0, 0, 0, 0));
[font color=#FF0000]button.setHideActionText(true);
[/font]
这句报错 the method setHideActionText is undifined for the type button
[/FIELDSET]
回复:JButton类可能不支持setHideActionText方法,虽然它继承了AbstractButton。请问你想用这个方法干啥?
2011-11-09
5L
[FIELDSET][LEGEND]引自:2楼[/LEGEND]
public static boolean insertRukuInfo(TbRukuMain ruMain) {
try {
boolean autoCommit = conn.getAutoCommit();
conn.setAutoCommit(false);
// 添加入库主表记录
insert("insert into tb_ruku_main values('" + ruMain.getRkId()
+ "','" + ruMain.getPzs() + "'," + ruMain.getJe() + ",'"
+ ruMain.getYsjl() + "','" + ruMain.getGysname() + "','"
+ ruMain.getRkdate() + "','" + ruMain.getCzy() + "','"
+ ruMain.getJsr() + "','" + ruMain.getJsfs() + "')");
Set<TbRukuDetail> rkDetails = ruMain.getTabRukuDetails();
for (Iterator<TbRukuDetail> iter = rkDetails.iterator(); iter
.hasNext();) {
TbRukuDetail details = iter.next();
// 添加入库详细表记录
insert("insert into tb_ruku_detail values('" + ruMain.getRkId()
+ "','" + details.getTabSpinfo() + "',"
+ details.getDj() + "," + details.getSl() + ")");
// 添加或修改库存表记录
Item item = new Item();
item.setId(details.getTabSpinfo());
TbSpinfo spInfo = getSpInfo(item);[font color=#FF0000]
if (spInfo.getId() != null && !spInfo.getId().isEmpty()) {
[/font] TbKucun kucun = getKucun(item);
if (kucun.getId() == null || kucun.getId().isEmpty()) {
the method isEmpty is undefined for the type string 这具体怎么改呢 老师 新手求教啊
[/FIELDSET]
回复:spInfo.getId()的返回值类型是?
public static boolean insertRukuInfo(TbRukuMain ruMain) {
try {
boolean autoCommit = conn.getAutoCommit();
conn.setAutoCommit(false);
// 添加入库主表记录
insert("insert into tb_ruku_main values('" + ruMain.getRkId()
+ "','" + ruMain.getPzs() + "'," + ruMain.getJe() + ",'"
+ ruMain.getYsjl() + "','" + ruMain.getGysname() + "','"
+ ruMain.getRkdate() + "','" + ruMain.getCzy() + "','"
+ ruMain.getJsr() + "','" + ruMain.getJsfs() + "')");
Set<TbRukuDetail> rkDetails = ruMain.getTabRukuDetails();
for (Iterator<TbRukuDetail> iter = rkDetails.iterator(); iter
.hasNext();) {
TbRukuDetail details = iter.next();
// 添加入库详细表记录
insert("insert into tb_ruku_detail values('" + ruMain.getRkId()
+ "','" + details.getTabSpinfo() + "',"
+ details.getDj() + "," + details.getSl() + ")");
// 添加或修改库存表记录
Item item = new Item();
item.setId(details.getTabSpinfo());
TbSpinfo spInfo = getSpInfo(item);[font color=#FF0000]
if (spInfo.getId() != null && !spInfo.getId().isEmpty()) {
[/font] TbKucun kucun = getKucun(item);
if (kucun.getId() == null || kucun.getId().isEmpty()) {
the method isEmpty is undefined for the type string 这具体怎么改呢 老师 新手求教啊
[/FIELDSET]
回复:spInfo.getId()的返回值类型是?