JavaSwing+derby电子相册

import java.awt.EventQueue; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.GroupLayout; import javax.swing.JFrame; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import tool.ScreenSize; public class AlbumFrame extends JFrame{ public AlbumFrame(){ initComponents(); ScreenSize.centered(this); } private void initComponents() { albumPanel1 = new AlbumPanel(); this.setDefaultLookAndFeelDecorated(true); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setTitle("电子相册"); GroupLayout layout = new GroupLayout(getContentPane()); getContentPane().setLayout(layout); //设置沿水平轴确定组件位置和大小的 Group。 Parallel:n. 平行线;对比 layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(albumPanel1, GroupLayout.DEFAULT_SIZE, 520, Short.MAX_VALUE)); //设置沿垂直轴确定组件位置和大小的 Group。 layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(albumPanel1, GroupLayout.DEFAULT_SIZE, 469, Short.MAX_VALUE)); this.pack(); } public static void main(String[] args) throws IllegalAccessException { /* try{ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); }catch(ClassNotFoundException e){ //Level 类定义了一组可用来控制日志输出的标准日志级别。severe:最高级别 //log()记录带有相关的可抛出信息的消息。 Logger.getLogger(AlbumFrame.class.getName()).log(Level.SEVERE, null, e); }catch(InstantiationException e){ Logger.getLogger(AlbumFrame.class.getName()).log(Level.SEVERE, null, e); }catch(UnsupportedLookAndFeelException e){ Logger.getLogger(AlbumFrame.class.getName()).log(Level.SEVERE, null, e); }*/ EventQueue.invokeLater(new Runnable(){ public void run(){ new AlbumFrame().setVisible(true); } }); } private AlbumPanel albumPanel1; }


相关文章:

  • 2021-12-14
  • 2021-12-29
  • 2022-02-10
  • 2022-12-23
  • 2021-08-14
  • 2021-11-14
猜你喜欢
  • 2021-08-08
  • 2021-11-27
  • 2021-08-21
  • 2021-08-05
  • 2021-12-05
  • 2021-04-13
相关资源
相似解决方案