毕业设计求助,导出的jar文件后双击运行出现如下情况
双击后出现
而且“最大化”是无效的,也不能关闭....
但是在Eclipse下运行主类能显示整个框架图
特来论坛求助下
Java SE Eclipse
--------------------编程问答--------------------
自己先顶一下,毕业的大事
--------------------编程问答--------------------
你应该把你的窗体初始化的那段代码发上来。
--------------------编程问答--------------------
package com.lzw;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.beans.PropertyVetoException;
import java.lang.reflect.Constructor;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.BoxLayout;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.border.BevelBorder;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;
import com.lzw.login.Login;
public class JXCFrame {
private JPanel sysManagePanel;
private JDesktopPane desktopPane;
private JFrame frame;
private JLabel backLabel;
// 创建窗体的Map类型集合对象
private Map<String, JInternalFrame> ifs = new HashMap<String, JInternalFrame>();
public JXCFrame() {
frame = new JFrame("企业进销存管理系统");
frame.getContentPane().setBackground(new Color(170, 188, 120));
frame.addComponentListener(new FrameListener());
frame.getContentPane().setLayout(new BorderLayout());
frame.setSize(800, 600);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
backLabel = new JLabel();// 背景标签
backLabel.setVerticalAlignment(SwingConstants.TOP);
backLabel.setHorizontalAlignment(SwingConstants.CENTER);
updateBackImage(); // 更新或初始化背景图片
desktopPane = new JDesktopPane();
desktopPane.add(backLabel, new Integer(Integer.MIN_VALUE));
frame.getContentPane().add(desktopPane);
JTabbedPane navigationPanel = createNavigationPanel(); // 创建导航标签面板
frame.getContentPane().add(navigationPanel, BorderLayout.NORTH);
frame.setVisible(true);
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new Login();
}
});
}
是这段吧...
--------------------编程问答--------------------
还有这段
package com.lzw.login;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.WindowConstants;
import model.TbUserlist;
import com.lzw.JXCFrame;
import com.lzw.dao.Dao;
public class Login extends JFrame {
private JLabel userLabel;
private JLabel passLabel;
private JButton exit;
private JButton login;
private static TbUserlist user;
public Login() {
setTitle("登录企业进销存管理系统");
final JPanel panel = new LoginPanel();
panel.setLayout(null);
getContentPane().add(panel);
setBounds(300, 200, panel.getWidth(), panel.getHeight());
userLabel = new JLabel();
userLabel.setText("用户名:");
userLabel.setBounds(100, 135, 200, 18);
panel.add(userLabel);
final JTextField userName = new JTextField();
userName.setBounds(150, 135, 200, 18);
panel.add(userName);
passLabel = new JLabel();
passLabel.setText("密 码:");
passLabel.setBounds(100, 165, 200, 18);
panel.add(passLabel);
final JPasswordField userPassword = new JPasswordField();
userPassword.addKeyListener(new KeyAdapter() {
public void keyPressed(final KeyEvent e) {
if (e.getKeyCode() == 10)
login.doClick();
}
});
userPassword.setBounds(150, 165, 200, 18);
panel.add(userPassword);
login = new JButton();
login.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
user = Dao.getUser(userName.getText(), userPassword.getText());
if (user.getUsername() == null || user.getName() == null) {
userName.setText(null);
userPassword.setText(null);
return;
}
setVisible(false);
new JXCFrame();
}
});
login.setText("登录");
login.setBounds(180, 195, 60, 18);
panel.add(login);
exit = new JButton();
exit.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
System.exit(0);
}
});
exit.setText("退出");
exit.setBounds(260, 195, 60, 18);
panel.add(exit);
setVisible(true);
setResizable(false);
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
}
public static TbUserlist getUser() {
return user;
}
public static void setUser(TbUserlist user) {
Login.user = user;
}
}
--------------------编程问答--------------------
你这main里new了个Login对象啊。
还有那个界面可以拖大吗?
你export会不会指定错了main入口?
--------------------编程问答--------------------
LoginPanel呢
--------------------编程问答--------------------