package frame; import java.awt.Color; import java.awt.GridLayout; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.io.IOException; import javax.swing.ImageIcon; import javax.swing.JEditorPane; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextPane; /** * Class to display custom window with * information about the devs * * @author * @version */ @SuppressWarnings("serial") public class aboutWindow extends JFrame{ /** * Default constructor for About frame * * @return */ public aboutWindow() { //Make frame with size, location, layout super("About SlideBrowser"); this.setSize(500, 330); this.setLocationRelativeTo(null); this.setLayout(new GridLayout(2, 1, 0, 0)); //Set the frame icon to an image loaded from a file. this.setIconImage(new ImageIcon(getClass().getResource("/resources/icon.png")).getImage()); JLabel aboutLabel = new JLabel(); aboutLabel.setIcon(new ImageIcon(getClass().getResource("/resources/Capture.PNG"))); //TODO fix html //Make html editor pane JEditorPane aboutPage = new JEditorPane(); aboutPage.setSize(350, 250); try { aboutPage.setContentType("text/html"); aboutPage.setEditable(false); aboutPage = new JEditorPane(getClass().getResource("/resources/about.html")); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } //end of line string variable String eol = System.getProperty("line.separator"); //TODO have credits contain all license information //for all multimedia and random shout outs String creditString; creditString = "Major thanks to Apache and Jakarta for the Jakarta Commons Net library, " + "a collection of network utilities and protocol implementations." + eol + "Also thanks to Phil Reeve for the Thumbnail class." + eol + "Many thanks to the various graphic artists who provide thier icons " + "as either open source or under the Creative Commons licenses." + eol + "Thanks to FatCow for their free web icons, licensed under CC Attribution 3.0. http://www.fatcow.com" + eol + "Christian Plattner's Ganymed SSH2 library also helped where Jakarta Commons Net didn't."; //TODO have the text scroll //Make scrolling credits pane JTextPane credits = new JTextPane(); credits.setText(creditString); credits.setSize(350, 250); credits.setBackground(Color.GRAY); credits.setForeground(Color.BLACK); //add everything this.add(aboutLabel); //this.add(aboutPage); this.add(credits); this.validate(); //Window Listener with default operation addWindowListener(new WindowListener(){ @Override public void windowActivated(WindowEvent arg0) {} @Override public void windowClosed(WindowEvent arg0) {} @Override public void windowClosing(WindowEvent arg0) {} @Override public void windowDeactivated(WindowEvent arg0) {} @Override public void windowDeiconified(WindowEvent arg0) {} @Override public void windowIconified(WindowEvent arg0) {} @Override public void windowOpened(WindowEvent arg0) {} }); setDefaultCloseOperation(DISPOSE_ON_CLOSE); } }