001 package com.croftsoft.apps.quiz; 002 003 import java.awt.*; 004 import javax.swing.JFrame; 005 import javax.swing.WindowConstants; 006 007 import com.croftsoft.core.gui.FrameManager; 008 import com.croftsoft.core.gui.ShutdownWindowListener; 009 import com.croftsoft.core.lang.lifecycle.Destroyable; 010 011 /********************************************************************* 012 * The main class for Quizzer. 013 * 014 * <p /> 015 * 016 * @version 017 * 2001-10-03 018 * @since 019 * 2001-07-10 020 * @author 021 * <a href="https://www.croftsoft.com/">David Wallace Croft</a> 022 *********************************************************************/ 023 024 public final class Quizzer 025 ////////////////////////////////////////////////////////////////////// 026 ////////////////////////////////////////////////////////////////////// 027 { 028 029 public static void main ( String [ ] args ) 030 ////////////////////////////////////////////////////////////////////// 031 { 032 QuizModel quizModel = new QuizModel ( ); 033 034 quizModel.init ( ); 035 036 JFrame jFrame = new JFrame ( ); 037 038 jFrame.getContentPane ( ).add ( new QuizPanel ( quizModel ) ); 039 040 jFrame.setDefaultCloseOperation ( 041 WindowConstants.DO_NOTHING_ON_CLOSE ); 042 043 Dimension size = Toolkit.getDefaultToolkit ( ).getScreenSize ( ); 044 045 size.width *= 0.8; 046 047 size.height *= 0.8; 048 049 FrameManager frameManager = new FrameManager ( 050 jFrame, "Quizzer", size, null ); 051 052 jFrame.addWindowListener ( new ShutdownWindowListener ( 053 new Destroyable [ ] { quizModel, frameManager } ) ); 054 055 frameManager.init ( ); 056 057 frameManager.start ( ); 058 } 059 060 ////////////////////////////////////////////////////////////////////// 061 ////////////////////////////////////////////////////////////////////// 062 }