Event; java. awt. event. ActionListener; java. io. BufferedReader; java. io. FileNotFoundException; java. io. FileReader; java. io. IOException; javax. swing. *; Javax. swing. border. Border; Main. menu; class art_frank {art_frank () {frm_art=new JFrame («Творчість Івана Франка»); _art. setSize (1000,730); _art. setDefaultCloseOperation (JFrame. DISPOSE_ON_CLOSE); experimentLayout=new GridLayout (13,2,50,50); border=BorderFactory. createLineBorder (Color. BLACK); panel=new JPanel (); panel1=new JPanel ();. setLayout (experimentLayout); panelt=new JPanel ();
/ / Блок (1) «Каменяр» ------------------------------------------------------------- path=«images/2_k.jpg »;. net. URL imgURL=menu. class. getResource (path); icon=new ImageIcon (imgURL); kart=new JButton («»);. setIcon (icon); _art. add (kart);. add (kart); frankotxt=new JTextArea (); contents=new StringBuffer (); reader=null; {= new BufferedReader (new FileReader («resources art kamenyar. txt»)); text=null; (( text=reader. readLine ())!=null) {. append (text). append (System. getProperty («line. separator»));
}} catch (FileNotFoundException e1) {. printStackTrace (); } Catch (IOException e1) {. printStackTrace ();
} finally {try {if (reader!=null) {. close (); }} (IOException e1) {e1. printStackTrace ();
}}. setText (contents. toString ());. setEditable (false);. setBorder (BorderFactory. createCompoundBorder (border, BorderFactory. createEmptyBorder (10, 10, 10,10)));. add (frankotxt); label1=new JLabel ();. add (label1);
/ / Кінець блоку (1
/ / Блок (13) посилання на агентство бібліотеку ---------------------------------------------- bil_lib=«images / knugu.jpg »;. net. URL imgURL_lib=menu. class. getResource (bil_lib); icon_lib=new ImageIcon (imgURL_lib); kart_lib=new JButton («»); _lib. setIcon (icon_lib); _art. add (kart_lib);. add (kart_lib); _lib. addActionListener (new ActionListener () {void actionPerformed (ActionEvent e) {lib_frank ();
}});
/ / Кінець блоку (13) ------------------------------------------------------------- panel1. add (panelt);. add (panel1); scrollBar=new JScrollPane (panel,. VERTICAL_SCROLLBAR_ALWAYS,. HORIZONTAL_SCROLLBAR_ALWAYS); _art. add (scrollBar); _art. setLocationRelativeTo (null); _art. setVisible (true);
} static void main (String args []) {. invokeLater (new Runnable () {void run () {art_frank ();
}}); }}
Файл life_frank. java:
package Main. Autobiography; java. io. IOException; javax. swing. JEditorPane; javax. swing. JFrame; javax. swing. JScrollPane; Main. menu; class life_frank {life_frank () {frm_life=new JFrame («Автобіографія Івана Франка»); pane1=new JEditorPane (); _life. setDefaultCloseOperation (JFrame. DISPOSE_ON_CLOSE); _life. setSize (1000,730); path1=«HTML / life_frank.html»;. net. URL URL=menu. class. getResource (path1); {. setPage (URL);
} catch (IOException e1) {
}. setEditable (false); _life. add (pane1); scrollBar=new JScrollPane (pane1, JScrollPane. VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane. HORIZONTAL_SCROLLBAR_ALWAYS); _life. add (scrollBar); _life. setLocationRelativeTo (n...