Hibernate中getMyHibernateTemplate().saveOrUpdate(obj)方法的作用,和具体的使用方法,各位位帮忙回答
2个回答
展开全部
可以了,代码修改如下,你自己运行下:
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Panel;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class CardLayoutTest extends Frame
{
static Panel panel = new Panel();
static Insets insets;
static Dimension men;
public static void main(String args[])
{
CardLayoutTest c = new CardLayoutTest();
c.setLayout(new BorderLayout(10, 10));
c.setBounds(10, 10, 300, 300); //修改的
insets = c.getInsets(); //修改的
men = c.getSize(); //修改的
c.setVisible(true);
c.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
}
public Insets getInsets()
{
return new Insets(10, 10, 10, 10);
}
public void paint(Graphics g)
{
super.paint(g);
g.setColor(Color.LIGHT_GRAY);
g.fillRect(0, 0, men.width, insets.top + 30); //修改的
}
}
如果对您有帮助,请记得采纳为满意答案,谢谢!祝您生活愉快!
vaela
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Panel;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class CardLayoutTest extends Frame
{
static Panel panel = new Panel();
static Insets insets;
static Dimension men;
public static void main(String args[])
{
CardLayoutTest c = new CardLayoutTest();
c.setLayout(new BorderLayout(10, 10));
c.setBounds(10, 10, 300, 300); //修改的
insets = c.getInsets(); //修改的
men = c.getSize(); //修改的
c.setVisible(true);
c.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
}
public Insets getInsets()
{
return new Insets(10, 10, 10, 10);
}
public void paint(Graphics g)
{
super.paint(g);
g.setColor(Color.LIGHT_GRAY);
g.fillRect(0, 0, men.width, insets.top + 30); //修改的
}
}
如果对您有帮助,请记得采纳为满意答案,谢谢!祝您生活愉快!
vaela
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询