Java JTattoo L&;F未正确应用于所有回转组件,don';我不明白为什么。。。?
我在我的应用程序上安装并正确应用了JTattoo L&F,但由于某些原因,主JFrame没有获得L&F!我认为这与它在主方法中使用.setVisible(true)实例化有关;方法,在为整个应用程序实例化JTattoo L&F之后!我尝试了一切,包括更改JFrame代码本身中的L&F,无论我做什么,都不起作用。。。它就是一动不动!在谷歌上寻找类似的问题,没有发现任何相关的问题,我已经在这个问题上花了好几个小时,但无法解决它,我尝试了一切!包括“逆向工程”的一些方法,什么都不管用 这是我的密码:Java JTattoo L&;F未正确应用于所有回转组件,don';我不明白为什么。。。?,java,swing,java-8,Java,Swing,Java 8,我在我的应用程序上安装并正确应用了JTattoo L&F,但由于某些原因,主JFrame没有获得L&F!我认为这与它在主方法中使用.setVisible(true)实例化有关;方法,在为整个应用程序实例化JTattoo L&F之后!我尝试了一切,包括更改JFrame代码本身中的L&F,无论我做什么,都不起作用。。。它就是一动不动!在谷歌上寻找类似的问题,没有发现任何相关的问题,我已经在这个问题上花了好几个小时,但无法解决它,我尝试了一切!包括“逆向工程”的一些方法,什么都不管用 这是我的密码:
public class DsrApplication {
public static MeniuPrincipalTaburi meniuTaburi = new MeniuPrincipalTaburi();
public static boolean isAdmin;
public static ArrayList<String> arrUti;
public static void main(String[] args) throws SQLException {
try {
//here you can put the selected theme class name in JTattoo
UIManager.setLookAndFeel("com.jtattoo.plaf.mint.MintLookAndFeel");
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(DsrApplication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(DsrApplication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(DsrApplication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(DsrApplication.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
String connectionUrl = String.format("jdbc:mysql://%s:%s/%s", "127.0.0.1", "3306", "dsr");
DataBaseConnection db = new DataBaseConnection(connectionUrl, "root", "@Root123#");
Connection conn = db.getConnection();
Logare logare = new Logare();
meniuTaburi.setVisible(true);
MeniuPrincipalTaburi.Meniu.addTabNoExit("Logare", logare.getContentPane());
MeniuPrincipalTaburi.Meniu.setSelectedComponent(logare.getContentPane());
Map<String, String> utilizatori = new HashMap<>();
UtilizatoriDAO userManagement = new UtilizatoriDAO(conn);
try {
utilizatori = userManagement.getAll();
} catch (SQLException ex) {
Logger.getLogger(CreeareUtilizatori.class.getName()).log(Level.SEVERE, null, ex);
}
Map<String, String> getUtilizatori = new HashMap<>();
System.out.println(getUtilizatori.get("Admin"));
FisierDAO fisierDB = new FisierDAO(db.getConnection());
List<Fisier> fisiere = new ArrayList<>();
fisiere = fisierDB.getAll();
arrUti = userManagement.getNames();
}
公共类数据应用程序{
公共静态MeniuPrincipalTaburi meniuTaburi=新MeniuPrincipalTaburi();
公共静态布尔isAdmin;
公共静态ArrayList arrUti;
公共静态void main(字符串[]args)引发SQLException{
试一试{
//在这里,您可以将所选主题类名放入jtagto中
UIManager.setLookAndFeel(“com.jttoo.plaf.mint.mintlokandfeel”);
}捕获(ClassNotFoundException ex){
java.util.logging.Logger.getLogger(DsrApplication.class.getName()).log(java.util.logging.Level.severy,null,ex);
}catch(实例化异常){
java.util.logging.Logger.getLogger(DsrApplication.class.getName()).log(java.util.logging.Level.severy,null,ex);
}捕获(非法访问例外){
java.util.logging.Logger.getLogger(DsrApplication.class.getName()).log(java.util.logging.Level.severy,null,ex);
}catch(javax.swing.UnsupportedLookAndFeelException ex){
java.util.logging.Logger.getLogger(DsrApplication.class.getName()).log(java.util.logging.Level.severy,null,ex);
}
String connectionUrl=String.format(“jdbc:mysql://%s:%s/%s”、“127.0.0.1”、“3306”、“dsr”);
DataBaseConnection db=新的DataBaseConnection(connectionUrl,“root”,“@Root123#”);
连接conn=db.getConnection();
Logare Logare=新Logare();
脑膜囊尾蚴可见(真);
MeniuPrincipalTaburi.Meniu.addTabNoExit(“Logare”,Logare.getContentPane());
MeniuPrincipalTaburi.Meniu.setSelectedComponent(logare.getContentPane());
Map utilizatori=new HashMap();
UtilizatoriDAO用户管理=新UtilizatoriDAO(conn);
试一试{
utilizatori=userManagement.getAll();
}catch(SQLException-ex){
Logger.getLogger(creeareautilizatori.class.getName()).log(Level.SEVERE,null,ex);
}
Map getUtilizatori=newhashmap();
System.out.println(getUtilizatori.get(“Admin”);
FisierDAO fisierDB=新的FisierDAO(db.getConnection());
List fisiere=new ArrayList();
fisiere=fisierDB.getAll();
arrUti=userManagement.getNames();
}
以下是JFrame的代码:
public class MeniuPrincipalTaburi extends javax.swing.JFrame {
/**
* Creates new form MeniuPrincipalTaburi
*/
public static JTabbedPaneCloseButton Meniu = new JTabbedPaneCloseButton();
public MeniuPrincipalTaburi() {
Meniu.setEnabled(true);
Meniu.setSize(1000, 500);
this.setSize(1000, 500);
this.add(Meniu);
initComponents();
ImageIcon img = new ImageIcon("C:\\Users\\Dragos\\Documents\\NetBeansProjects\\project\\Fisiere\\Alte Documente\\Logo\\transformator.png");
this.setIconImage(img.getImage());
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Sistem informatic laborator");
addContainerListener(new java.awt.event.ContainerAdapter() {
public void componentAdded(java.awt.event.ContainerEvent evt) {
formComponentAdded(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 1008, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 665, Short.MAX_VALUE)
);
pack();
}// </editor-fold>
private void formComponentAdded(java.awt.event.ContainerEvent evt) {
// TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
UIManager.setLookAndFeel("com.jtattoo.plaf.mint.MintLookAndFeel");
/*if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}*/
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(MeniuPrincipalTaburi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MeniuPrincipalTaburi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MeniuPrincipalTaburi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MeniuPrincipalTaburi.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MeniuPrincipalTaburi().setEnabled(true);
}
});
}
// Variables declaration - do not modify
// End of variables declaration
}
公共类meniumprincipaltaburi扩展了javax.swing.JFrame{
/**
*创建新表单paltaburi
*/
公共静态JTabbedPaneCloseButton Meniu=新JTabbedPaneCloseButton();
公共卫生机构{
Meniu.setEnabled(真);
Meniu.setSize(1000500);
此.setSize(1000500);
本条增补(Meniu);
初始化组件();
ImageIcon img=新的ImageIcon(“C:\\Users\\Dragos\\Documents\\NetBeansProjects\\project\\Fisiere\\Alte Documente\\Logo\\transformator.png”);
this.setIconImage(img.getImage());
}
/**
*从构造函数中调用此方法来初始化表单。
*警告:不要修改此代码。此方法的内容始终为
*由表单编辑器重新生成。
*/
@抑制警告(“未选中”)
//
私有组件(){
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle(“Sistem信息实验室”);
addContainerListener(新的java.awt.event.ContainerAdapter(){
添加了公共void组件(java.awt.event.ContainerEvent evt){
formComponentAdded(evt);
}
});
javax.swing.GroupLayout=newjavax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(布局);
layout.setHorizontalGroup(
createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0,1008,短。最大值)
);
layout.setVerticalGroup(
createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0,665,短。最大值)
);
包装();
}//
private void formComponentAdded(java.awt.event.ContainerEvent evt){
//TODO在此处添加您的处理代码:
}
/**
*@param指定命令行参数
*/
公共静态void main(字符串参数[]){
/*设置Nimbus的外观和感觉*/
//
/*如果Nimbus(在JavaSE6中引入)不可用,请使用默认的外观。
*详情请参阅http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
试一试{
for(javax.swing.UIManager.LookAndFeelInfo:javax.swing.UIManager.getInstalledLookAndFeels()){
UIManager.setLookAndFeel(“com.jttoo.plaf.mint.mintlokandfeel”);
/*if(“Nimbus”.equals(info.getName())){
setLookAndFeel(info.getClassName());
打破
}*/
}
}捕获(ClassNotFoundException ex){
java.util.logging.Logger.getLogger(meniumprincipaltaburi.class.getName()).log(java.util.logging.Level.SEVERE,null,ex);
}抓住