Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 42.86 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package zoogui;
  7.  
  8. import java.awt.Color;
  9. import javax.swing.JApplet;
  10.  
  11. /**
  12. *
  13. * @author kando1927
  14. */
  15. public class zoogui extends javax.swing.JFrame {
  16.  
  17. /**
  18. * Creates new form zoogui
  19. */
  20. ClassLoader AssetLoader = this.getClass().getClassLoader();
  21.  
  22. java.applet.AudioClip bearSound = JApplet.newAudioClip(AssetLoader.getResource("BeetovenBear.wav"));
  23. java.applet.AudioClip eurasianSound = JApplet.newAudioClip(AssetLoader.getResource("BachBear.wav"));
  24. java.applet.AudioClip slothSound = JApplet.newAudioClip(AssetLoader.getResource("SchubertBear.wav"));
  25. java.applet.AudioClip brownSound = JApplet.newAudioClip(AssetLoader.getResource("Brahm.wav"));
  26.  
  27. java.applet.AudioClip monkeySound = JApplet.newAudioClip(AssetLoader.getResource("MonteverdiMonkey.wav"));
  28. java.applet.AudioClip patasSound = JApplet.newAudioClip(AssetLoader.getResource("PatasMonkey.wav"));
  29. java.applet.AudioClip tamarinSound = JApplet.newAudioClip(AssetLoader.getResource("TamarinMonkey.wav"));
  30. java.applet.AudioClip capuchinSound = JApplet.newAudioClip(AssetLoader.getResource("WhiteCapuchin.wav"));
  31.  
  32. java.applet.AudioClip birdSound = JApplet.newAudioClip(AssetLoader.getResource("BrittenBird.wav"));
  33. java.applet.AudioClip frigateSound = JApplet.newAudioClip(AssetLoader.getResource("FaureFrigate.wav"));
  34. java.applet.AudioClip pigeonSound = JApplet.newAudioClip(AssetLoader.getResource("ProkofievPigeon.wav"));
  35. java.applet.AudioClip puffinSound = JApplet.newAudioClip(AssetLoader.getResource("PucciniPuffin.wav"));
  36.  
  37. public zoogui() {
  38. initComponents();
  39. }
  40.  
  41. /**
  42. * This method is called from within the constructor to initialize the form.
  43. * WARNING: Do NOT modify this code. The content of this method is always
  44. * regenerated by the Form Editor.
  45. */
  46. @SuppressWarnings("unchecked")
  47. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  48. private void initComponents() {
  49.  
  50. pnl_opener = new javax.swing.JPanel();
  51. jButton1 = new javax.swing.JButton();
  52. jLabel2 = new javax.swing.JLabel();
  53. jLabel1 = new javax.swing.JLabel();
  54. pnl_monkey = new javax.swing.JPanel();
  55. lbl_titleMonkey = new javax.swing.JLabel();
  56. lbl_info1Monkey = new javax.swing.JLabel();
  57. lbl_info2Monkey = new javax.swing.JLabel();
  58. lbl_imgMonkey = new javax.swing.JLabel();
  59. btn_patas = new javax.swing.JButton();
  60. btn_capuchin = new javax.swing.JButton();
  61. btn_tamarin = new javax.swing.JButton();
  62. lbl_info1BehaviorsMo = new javax.swing.JLabel();
  63. lbl_info2BehaviorsMo = new javax.swing.JLabel();
  64. lbl_info3BehaviorsMo = new javax.swing.JLabel();
  65. lbl_info1AttributesMo = new javax.swing.JLabel();
  66. lbl_info2AttributesMo = new javax.swing.JLabel();
  67. lbl_info3AttributesMo = new javax.swing.JLabel();
  68. pnl_bear = new javax.swing.JPanel();
  69. lbl_titleBear = new javax.swing.JLabel();
  70. lbl_imgBear = new javax.swing.JLabel();
  71. lbl_info2Bear = new javax.swing.JLabel();
  72. lbl_info1Bear = new javax.swing.JLabel();
  73. btn_sloth = new javax.swing.JButton();
  74. btn_eursasian = new javax.swing.JButton();
  75. btn_brown = new javax.swing.JButton();
  76. lbl_info1BehaviorsBe = new javax.swing.JLabel();
  77. lbl_info2BehaviorsBe = new javax.swing.JLabel();
  78. lbl_info3BehaviorsBe = new javax.swing.JLabel();
  79. lbl_info1AttributesBe = new javax.swing.JLabel();
  80. lbl_info2AttributesBe = new javax.swing.JLabel();
  81. lbl_info3AttributesBe = new javax.swing.JLabel();
  82. pnl_bird = new javax.swing.JPanel();
  83. lnl_titleBird = new javax.swing.JLabel();
  84. lbl_info1Bird = new javax.swing.JLabel();
  85. lbl_info2Bird = new javax.swing.JLabel();
  86. lbl_imgBird = new javax.swing.JLabel();
  87. btn_frigate = new javax.swing.JButton();
  88. btn_pigeon = new javax.swing.JButton();
  89. btn_puffin = new javax.swing.JButton();
  90. lbl_info1BehaviorsBi = new javax.swing.JLabel();
  91. lbl_info2BehaviorsBi = new javax.swing.JLabel();
  92. lbl_info3BehaviorsBi = new javax.swing.JLabel();
  93. lbl_info1AttributesBi = new javax.swing.JLabel();
  94. lbl_info2AttributesBi = new javax.swing.JLabel();
  95. lbl_info3AttributesBi = new javax.swing.JLabel();
  96. pnl_superClass = new javax.swing.JPanel();
  97. btn_monkey = new javax.swing.JButton();
  98. btn_bird = new javax.swing.JButton();
  99. btn_bear = new javax.swing.JButton();
  100.  
  101. pnl_opener.setLayout(null);
  102.  
  103. jButton1.setText("Start");
  104. pnl_opener.add(jButton1);
  105. jButton1.setBounds(260, 250, 130, 30);
  106.  
  107. jLabel2.setFont(new java.awt.Font("Tw Cen MT Condensed", 1, 36)); // NOI18N
  108. jLabel2.setText(" The KMM Zoo");
  109. pnl_opener.add(jLabel2);
  110. jLabel2.setBounds(220, 100, 200, 80);
  111.  
  112. jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/bg2.jpg"))); // NOI18N
  113. pnl_opener.add(jLabel1);
  114. jLabel1.setBounds(30, 0, 600, 460);
  115.  
  116. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  117. setPreferredSize(new java.awt.Dimension(730, 505));
  118.  
  119. pnl_monkey.setBackground(new java.awt.Color(255, 255, 204));
  120. pnl_monkey.setVisible(false);
  121.  
  122. lbl_titleMonkey.setFont(new java.awt.Font("Tw Cen MT Condensed", 1, 36)); // NOI18N
  123. lbl_titleMonkey.setText("Monkeys");
  124.  
  125. lbl_info1Monkey.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
  126. lbl_info1Monkey.setText("Behaviors:");
  127.  
  128. lbl_info2Monkey.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
  129. lbl_info2Monkey.setText("Attributes:");
  130.  
  131. lbl_imgMonkey.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/Claudio Giovanni Antonio Monkey.jpg"))); // NOI18N
  132.  
  133. btn_patas.setText("Patas Monkey");
  134. btn_patas.addActionListener(new java.awt.event.ActionListener() {
  135. public void actionPerformed(java.awt.event.ActionEvent evt) {
  136. btn_patasActionPerformed(evt);
  137. }
  138. });
  139.  
  140. btn_capuchin.setText("White-headed Capuchin");
  141. btn_capuchin.addActionListener(new java.awt.event.ActionListener() {
  142. public void actionPerformed(java.awt.event.ActionEvent evt) {
  143. btn_capuchinActionPerformed(evt);
  144. }
  145. });
  146.  
  147. btn_tamarin.setText("Emperor Tamarin");
  148. btn_tamarin.addActionListener(new java.awt.event.ActionListener() {
  149. public void actionPerformed(java.awt.event.ActionEvent evt) {
  150. btn_tamarinActionPerformed(evt);
  151. }
  152. });
  153.  
  154. lbl_info1BehaviorsMo.setText("- Omnivore");
  155.  
  156. lbl_info2BehaviorsMo.setText("- Climbs trees");
  157.  
  158. lbl_info3BehaviorsMo.setText("- Socialze with others");
  159.  
  160. lbl_info1AttributesMo.setText("- Social");
  161.  
  162. lbl_info2AttributesMo.setText("- Have tails");
  163.  
  164. lbl_info3AttributesMo.setText("- Intellegent");
  165.  
  166. javax.swing.GroupLayout pnl_monkeyLayout = new javax.swing.GroupLayout(pnl_monkey);
  167. pnl_monkey.setLayout(pnl_monkeyLayout);
  168. pnl_monkeyLayout.setHorizontalGroup(
  169. pnl_monkeyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  170. .addGroup(pnl_monkeyLayout.createSequentialGroup()
  171. .addGroup(pnl_monkeyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  172. .addGroup(pnl_monkeyLayout.createSequentialGroup()
  173. .addGap(35, 35, 35)
  174. .addComponent(lbl_imgMonkey)
  175. .addGap(18, 18, 18)
  176. .addGroup(pnl_monkeyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  177. .addComponent(lbl_info1Monkey)
  178. .addComponent(lbl_info1BehaviorsMo)
  179. .addComponent(lbl_info2BehaviorsMo)
  180. .addComponent(lbl_info3AttributesMo)
  181. .addComponent(lbl_info2Monkey)
  182. .addComponent(lbl_info3BehaviorsMo)
  183. .addComponent(lbl_info1AttributesMo)
  184. .addComponent(lbl_info2AttributesMo)))
  185. .addGroup(pnl_monkeyLayout.createSequentialGroup()
  186. .addGap(21, 21, 21)
  187. .addComponent(btn_patas)
  188. .addGap(36, 36, 36)
  189. .addComponent(btn_capuchin)
  190. .addGap(32, 32, 32)
  191. .addComponent(btn_tamarin))
  192. .addGroup(pnl_monkeyLayout.createSequentialGroup()
  193. .addGap(284, 284, 284)
  194. .addComponent(lbl_titleMonkey)))
  195. .addContainerGap(305, Short.MAX_VALUE))
  196. );
  197. pnl_monkeyLayout.setVerticalGroup(
  198. pnl_monkeyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  199. .addGroup(pnl_monkeyLayout.createSequentialGroup()
  200. .addGap(23, 23, 23)
  201. .addComponent(lbl_titleMonkey, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
  202. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  203. .addGroup(pnl_monkeyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  204. .addComponent(lbl_imgMonkey)
  205. .addGroup(pnl_monkeyLayout.createSequentialGroup()
  206. .addComponent(lbl_info1Monkey)
  207. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  208. .addComponent(lbl_info1BehaviorsMo)
  209. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  210. .addComponent(lbl_info2BehaviorsMo)
  211. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  212. .addComponent(lbl_info3BehaviorsMo)
  213. .addGap(29, 29, 29)
  214. .addComponent(lbl_info2Monkey)
  215. .addGap(7, 7, 7)
  216. .addComponent(lbl_info1AttributesMo)
  217. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  218. .addComponent(lbl_info2AttributesMo)
  219. .addGap(8, 8, 8)
  220. .addComponent(lbl_info3AttributesMo)))
  221. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 63, Short.MAX_VALUE)
  222. .addGroup(pnl_monkeyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  223. .addComponent(btn_tamarin)
  224. .addComponent(btn_capuchin)
  225. .addComponent(btn_patas))
  226. .addGap(20, 20, 20))
  227. );
  228.  
  229. pnl_bear.setBackground(new java.awt.Color(255, 255, 204));
  230. pnl_bear.setVisible(false);
  231.  
  232. lbl_titleBear.setFont(new java.awt.Font("Tw Cen MT Condensed", 1, 36)); // NOI18N
  233. lbl_titleBear.setText("Bears");
  234.  
  235. lbl_imgBear.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/Ludwig Van Bearthoven.jpg"))); // NOI18N
  236.  
  237. lbl_info2Bear.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
  238. lbl_info2Bear.setText("Attributes:");
  239.  
  240. lbl_info1Bear.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
  241. lbl_info1Bear.setText("Behaviors:");
  242.  
  243. btn_sloth.setText("Sloth Bear");
  244. btn_sloth.addActionListener(new java.awt.event.ActionListener() {
  245. public void actionPerformed(java.awt.event.ActionEvent evt) {
  246. btn_slothActionPerformed(evt);
  247. }
  248. });
  249.  
  250. btn_eursasian.setText("Eurasian Bear");
  251. btn_eursasian.addActionListener(new java.awt.event.ActionListener() {
  252. public void actionPerformed(java.awt.event.ActionEvent evt) {
  253. btn_eursasianActionPerformed(evt);
  254. }
  255. });
  256.  
  257. btn_brown.setText("Brown Bear");
  258. btn_brown.addActionListener(new java.awt.event.ActionListener() {
  259. public void actionPerformed(java.awt.event.ActionEvent evt) {
  260. btn_brownActionPerformed(evt);
  261. }
  262. });
  263.  
  264. lbl_info1BehaviorsBe.setText("- Hunt");
  265.  
  266. lbl_info2BehaviorsBe.setText("- Compose music");
  267.  
  268. lbl_info3BehaviorsBe.setText("- Hibernate");
  269.  
  270. lbl_info1AttributesBe.setText("- Musically inclined");
  271.  
  272. lbl_info2AttributesBe.setText("- Curious");
  273.  
  274. lbl_info3AttributesBe.setText("- Has fur");
  275.  
  276. javax.swing.GroupLayout pnl_bearLayout = new javax.swing.GroupLayout(pnl_bear);
  277. pnl_bear.setLayout(pnl_bearLayout);
  278. pnl_bearLayout.setHorizontalGroup(
  279. pnl_bearLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  280. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnl_bearLayout.createSequentialGroup()
  281. .addGroup(pnl_bearLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  282. .addGroup(pnl_bearLayout.createSequentialGroup()
  283. .addGap(63, 63, 63)
  284. .addGroup(pnl_bearLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  285. .addGroup(pnl_bearLayout.createSequentialGroup()
  286. .addComponent(lbl_imgBear)
  287. .addGap(18, 18, 18)
  288. .addGroup(pnl_bearLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  289. .addComponent(lbl_info1Bear)
  290. .addComponent(lbl_info1AttributesBe)
  291. .addComponent(lbl_info2AttributesBe)
  292. .addComponent(lbl_info3AttributesBe)
  293. .addComponent(lbl_titleBear)))
  294. .addGroup(pnl_bearLayout.createSequentialGroup()
  295. .addGap(218, 218, 218)
  296. .addGroup(pnl_bearLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  297. .addComponent(lbl_info2Bear)
  298. .addComponent(lbl_info1BehaviorsBe)
  299. .addComponent(lbl_info2BehaviorsBe)
  300. .addComponent(lbl_info3BehaviorsBe)))))
  301. .addGroup(pnl_bearLayout.createSequentialGroup()
  302. .addGap(40, 40, 40)
  303. .addComponent(btn_sloth)
  304. .addGap(62, 62, 62)
  305. .addComponent(btn_eursasian)
  306. .addGap(60, 60, 60)
  307. .addComponent(btn_brown)))
  308. .addContainerGap(324, Short.MAX_VALUE))
  309. );
  310. pnl_bearLayout.setVerticalGroup(
  311. pnl_bearLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  312. .addGroup(pnl_bearLayout.createSequentialGroup()
  313. .addGap(20, 20, 20)
  314. .addComponent(lbl_titleBear)
  315. .addGap(21, 21, 21)
  316. .addGroup(pnl_bearLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  317. .addComponent(lbl_imgBear)
  318. .addGroup(pnl_bearLayout.createSequentialGroup()
  319. .addComponent(lbl_info1Bear)
  320. .addGap(7, 7, 7)
  321. .addComponent(lbl_info1BehaviorsBe)
  322. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  323. .addComponent(lbl_info2BehaviorsBe)
  324. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  325. .addComponent(lbl_info3BehaviorsBe)
  326. .addGap(36, 36, 36)
  327. .addComponent(lbl_info2Bear)
  328. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  329. .addComponent(lbl_info1AttributesBe)
  330. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  331. .addComponent(lbl_info2AttributesBe)
  332. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  333. .addComponent(lbl_info3AttributesBe)
  334. .addGap(19, 19, 19)))
  335. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 33, Short.MAX_VALUE)
  336. .addGroup(pnl_bearLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  337. .addComponent(btn_eursasian)
  338. .addComponent(btn_sloth)
  339. .addComponent(btn_brown))
  340. .addGap(39, 39, 39))
  341. );
  342.  
  343. pnl_bird.setBackground(new java.awt.Color(255, 255, 204));
  344. //pnl_bird.setVisible(false);
  345.  
  346. lnl_titleBird.setFont(new java.awt.Font("Tw Cen MT Condensed", 1, 36)); // NOI18N
  347. lnl_titleBird.setText("Birds");
  348.  
  349. lbl_info1Bird.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
  350. lbl_info1Bird.setText("Behaviors:");
  351.  
  352. lbl_info2Bird.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
  353. lbl_info2Bird.setText("Attributes:");
  354.  
  355. lbl_imgBird.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/Benjamin Bird.jpg"))); // NOI18N
  356.  
  357. btn_frigate.setText("Maginificent Frigate Bird");
  358. btn_frigate.addActionListener(new java.awt.event.ActionListener() {
  359. public void actionPerformed(java.awt.event.ActionEvent evt) {
  360. btn_frigateActionPerformed(evt);
  361. }
  362. });
  363.  
  364. btn_pigeon.setText("Pigeon");
  365. btn_pigeon.addActionListener(new java.awt.event.ActionListener() {
  366. public void actionPerformed(java.awt.event.ActionEvent evt) {
  367. btn_pigeonActionPerformed(evt);
  368. }
  369. });
  370.  
  371. btn_puffin.setText("Puffin");
  372. btn_puffin.addActionListener(new java.awt.event.ActionListener() {
  373. public void actionPerformed(java.awt.event.ActionEvent evt) {
  374. btn_puffinActionPerformed(evt);
  375. }
  376. });
  377.  
  378. lbl_info1BehaviorsBi.setText("- Dives into water to get inspiration");
  379.  
  380. lbl_info2BehaviorsBi.setText("- Combs mustache with claws");
  381.  
  382. lbl_info3BehaviorsBi.setText("- Sings to annoy people");
  383.  
  384. lbl_info1AttributesBi.setText("- Orange beak");
  385.  
  386. lbl_info2AttributesBi.setText("- Black and white feathers");
  387.  
  388. lbl_info3AttributesBi.setText("- Short and stubby");
  389.  
  390. javax.swing.GroupLayout pnl_birdLayout = new javax.swing.GroupLayout(pnl_bird);
  391. pnl_bird.setLayout(pnl_birdLayout);
  392. pnl_birdLayout.setHorizontalGroup(
  393. pnl_birdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  394. .addGroup(pnl_birdLayout.createSequentialGroup()
  395. .addGroup(pnl_birdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  396. .addGroup(pnl_birdLayout.createSequentialGroup()
  397. .addGap(33, 33, 33)
  398. .addComponent(btn_frigate))
  399. .addGroup(pnl_birdLayout.createSequentialGroup()
  400. .addGap(53, 53, 53)
  401. .addComponent(lbl_imgBird)
  402. .addGap(18, 18, 18)
  403. .addGroup(pnl_birdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  404. .addComponent(lbl_info1Bird)
  405. .addComponent(lbl_info2Bird)
  406. .addComponent(lbl_info1BehaviorsBi)
  407. .addComponent(lbl_info3BehaviorsBi)
  408. .addComponent(lbl_info1AttributesBi)
  409. .addComponent(lbl_info3AttributesBi)
  410. .addComponent(lnl_titleBird)
  411. .addComponent(lbl_info2AttributesBi)
  412. .addGroup(pnl_birdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
  413. .addComponent(btn_puffin)
  414. .addComponent(lbl_info2BehaviorsBi))))
  415. .addGroup(pnl_birdLayout.createSequentialGroup()
  416. .addGap(223, 223, 223)
  417. .addComponent(btn_pigeon)))
  418. .addContainerGap(313, Short.MAX_VALUE))
  419. );
  420. pnl_birdLayout.setVerticalGroup(
  421. pnl_birdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  422. .addGroup(pnl_birdLayout.createSequentialGroup()
  423. .addContainerGap()
  424. .addComponent(lnl_titleBird)
  425. .addGroup(pnl_birdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  426. .addGroup(pnl_birdLayout.createSequentialGroup()
  427. .addGap(39, 39, 39)
  428. .addGroup(pnl_birdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  429. .addGroup(pnl_birdLayout.createSequentialGroup()
  430. .addComponent(lbl_info1Bird)
  431. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  432. .addComponent(lbl_info1BehaviorsBi)
  433. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  434. .addComponent(lbl_info2BehaviorsBi)
  435. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  436. .addComponent(lbl_info3BehaviorsBi)
  437. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  438. .addComponent(lbl_info2Bird)
  439. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  440. .addComponent(lbl_info1AttributesBi)
  441. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  442. .addComponent(lbl_info2AttributesBi)
  443. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  444. .addComponent(lbl_info3AttributesBi))
  445. .addComponent(lbl_imgBird))
  446. .addGap(43, 115, Short.MAX_VALUE))
  447. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnl_birdLayout.createSequentialGroup()
  448. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  449. .addGroup(pnl_birdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  450. .addComponent(btn_frigate)
  451. .addComponent(btn_pigeon)
  452. .addComponent(btn_puffin))
  453. .addGap(34, 34, 34))))
  454. );
  455.  
  456. pnl_superClass.setBackground(new java.awt.Color(204, 255, 255));
  457. //pnl_superClass.setVisible(false);
  458.  
  459. btn_monkey.setText("Monkeys");
  460. btn_monkey.addActionListener(new java.awt.event.ActionListener() {
  461. public void actionPerformed(java.awt.event.ActionEvent evt) {
  462. btn_monkeyActionPerformed(evt);
  463. }
  464. });
  465.  
  466. btn_bird.setText("Birds");
  467. btn_bird.addActionListener(new java.awt.event.ActionListener() {
  468. public void actionPerformed(java.awt.event.ActionEvent evt) {
  469. btn_birdActionPerformed(evt);
  470. }
  471. });
  472.  
  473. btn_bear.setText("Bears");
  474. btn_bear.addActionListener(new java.awt.event.ActionListener() {
  475. public void actionPerformed(java.awt.event.ActionEvent evt) {
  476. btn_bearActionPerformed(evt);
  477. }
  478. });
  479.  
  480. javax.swing.GroupLayout pnl_superClassLayout = new javax.swing.GroupLayout(pnl_superClass);
  481. pnl_superClass.setLayout(pnl_superClassLayout);
  482. pnl_superClassLayout.setHorizontalGroup(
  483. pnl_superClassLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  484. .addGroup(pnl_superClassLayout.createSequentialGroup()
  485. .addGap(47, 47, 47)
  486. .addComponent(btn_bear)
  487. .addGap(93, 93, 93)
  488. .addComponent(btn_monkey)
  489. .addGap(107, 107, 107)
  490. .addComponent(btn_bird)
  491. .addContainerGap(317, Short.MAX_VALUE))
  492. );
  493. pnl_superClassLayout.setVerticalGroup(
  494. pnl_superClassLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  495. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnl_superClassLayout.createSequentialGroup()
  496. .addContainerGap(30, Short.MAX_VALUE)
  497. .addGroup(pnl_superClassLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  498. .addComponent(btn_monkey)
  499. .addComponent(btn_bird)
  500. .addComponent(btn_bear))
  501. .addGap(32, 32, 32))
  502. );
  503.  
  504. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  505. getContentPane().setLayout(layout);
  506. layout.setHorizontalGroup(
  507. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  508. .addComponent(pnl_superClass, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  509. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  510. .addComponent(pnl_bird, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  511. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  512. .addComponent(pnl_bear, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  513. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  514. .addComponent(pnl_monkey, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  515. );
  516. layout.setVerticalGroup(
  517. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  518. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  519. .addGap(0, 379, Short.MAX_VALUE)
  520. .addComponent(pnl_superClass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  521. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  522. .addGroup(layout.createSequentialGroup()
  523. .addComponent(pnl_bird, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  524. .addGap(0, 64, Short.MAX_VALUE)))
  525. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  526. .addGroup(layout.createSequentialGroup()
  527. .addComponent(pnl_bear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  528. .addGap(0, 70, Short.MAX_VALUE)))
  529. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  530. .addGroup(layout.createSequentialGroup()
  531. .addComponent(pnl_monkey, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
  532. .addGap(0, 91, Short.MAX_VALUE)))
  533. );
  534.  
  535. pack();
  536. }// </editor-fold>
  537.  
  538. private void btn_bearActionPerformed(java.awt.event.ActionEvent evt) {
  539. lbl_imgBear.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/Ludwig Van Bearthoven.jpg")));
  540. //CHANGE TITLE TO FRIGATE BIRD
  541. lbl_titleBear.setText("Bears");
  542. pnl_bear.setVisible(true);
  543. pnl_bird.setVisible(false);
  544. pnl_monkey.setVisible(false);
  545. pnl_bear.setBackground(new java.awt.Color(204, 255, 204));
  546. }
  547.  
  548. private void btn_monkeyActionPerformed(java.awt.event.ActionEvent evt) {
  549. lbl_imgMonkey.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/Claudio Giovanni Antonio Monkey.jpg")));
  550. pnl_bear.setVisible(false);
  551. pnl_bird.setVisible(false);
  552. pnl_monkey.setVisible(true);
  553. //CHANGE TITLE TO FRIGATE BIRD
  554. lbl_titleMonkey.setText("Monkeys");
  555.  
  556. //CHANGES TO SUPER CLASS MONKEY BEHAVIORS
  557. lbl_info1BehaviorsMo.setText("- Omnivore");
  558. lbl_info2BehaviorsMo.setText("- Climbs trees");
  559. lbl_info3BehaviorsMo.setText("- Socialize with others");
  560. //CHANGES TO SUPER CLASS MONKEY ATTRIBUTES
  561. lbl_info1AttributesMo.setText("- Social");
  562. lbl_info2AttributesMo.setText("- Have tails");
  563. lbl_info3AttributesMo.setText("- Intelligent");
  564.  
  565. pnl_monkey.setBackground(new java.awt.Color(196, 182, 225));
  566. }
  567.  
  568. private void btn_birdActionPerformed(java.awt.event.ActionEvent evt) {
  569. lbl_imgBird.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/Benjamin Bird.jpg")));
  570. //CHANGE TITLE TO BIRD
  571. lnl_titleBird.setText("Birds");
  572. pnl_bear.setVisible(false);
  573. pnl_bird.setVisible(true);
  574. pnl_monkey.setVisible(false);
  575. }
  576.  
  577. private void btn_patasActionPerformed(java.awt.event.ActionEvent evt) {
  578. lbl_imgMonkey.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/Henry Patas Monkey.jpg")));
  579. //CHANGE TITLE TO TAMARIN MONKEY
  580. lbl_titleMonkey.setText("Patas Monkey");
  581. //CHANGES TO SUB CLASS PATAS BEHAVIORS
  582. lbl_info1BehaviorsMo.setText("- Wheres white evening gloves just to walk around casually");
  583. lbl_info2BehaviorsMo.setText("- Practices the operas he writes in his living room");
  584. lbl_info3BehaviorsMo.setText("- Swings from tree to tree like Tarzan");
  585. //CHANGES TO SUB CLASS PATAS ATTRIBUTES
  586. lbl_info1AttributesMo.setText("- Primped curled hair");
  587. lbl_info2AttributesMo.setText("- Long tails to whip the haters");
  588. lbl_info3AttributesMo.setText("- Proper");
  589.  
  590. }
  591.  
  592. private void btn_capuchinActionPerformed(java.awt.event.ActionEvent evt) {
  593. lbl_imgMonkey.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/Wilhelm Richard White-Headed Capuchin.jpg")));
  594. //CHANGE TITLE TO CAPUCHIN MONKEY
  595. lbl_titleMonkey.setText("Capuchin Monkey");
  596. //CHANGES TO SUB CLASS CAPUCHIN BEHAVIORS
  597. lbl_info1BehaviorsMo.setText("- Singing");
  598. lbl_info2BehaviorsMo.setText("- Jumping");
  599. lbl_info3BehaviorsMo.setText("- Laughing despite grumpy face");
  600. //CHANGES TO SUB CLASS CAPUCHIN ATTRIBUTES
  601. lbl_info1AttributesMo.setText("- White neck");
  602. lbl_info2AttributesMo.setText("- Gray face");
  603. lbl_info3AttributesMo.setText("- Black feet");
  604. }
  605.  
  606. private void btn_tamarinActionPerformed(java.awt.event.ActionEvent evt) {
  607. lbl_imgMonkey.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/Carl Maria Friedrich Emperor Tamarin.jpg")));
  608. //CHANGE TITLE TO TAMARIN MONKEY
  609. lbl_titleMonkey.setText("Tamarin Monkey");
  610. //CHANGES TO SUB CLASS TAMARIN BEHAVIORS
  611. lbl_info1BehaviorsMo.setText("- Conducts other monkeys in song");
  612. lbl_info2BehaviorsMo.setText("- Brushes his mustache every time he is done with a performance");
  613. lbl_info3BehaviorsMo.setText("- Eats a banana split twice everyday");
  614. //CHANGES TO SUB CLASS TAMARIN ATTRIBUTES
  615. lbl_info1AttributesMo.setText("- White, long, handlebar mustache");
  616. lbl_info2AttributesMo.setText("- Brown curly hair");
  617. lbl_info3AttributesMo.setText("- Small precise hands");
  618. }
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626. private void btn_slothActionPerformed(java.awt.event.ActionEvent evt) {
  627. lbl_imgBear.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/Franz Peter Slothbert Bear.jpg")));
  628. //CHANGE TITLE TO SLOTH BEAR
  629. lbl_titleBear.setText("Sloth Bear");
  630. //CHANGES TO SUB CLASS SLOTH BEHAVIORS
  631. lbl_info1BehaviorsBe.setText("- Lounges around in the most comfortable spots before practicing his music");
  632. lbl_info2BehaviorsBe.setText("- Shows off his musical talents");
  633. lbl_info3BehaviorsBe.setText("- Stays up all night to party");
  634. //CHANGES TO SUB CLASS SLOTH ATTRIBUTES
  635. lbl_info1AttributesBe.setText("- Very, very tall");
  636. lbl_info2AttributesBe.setText("- Weighs A LOT to show off to the females");
  637. lbl_info3AttributesBe.setText("- Long sharp claws");
  638. }
  639.  
  640. private void btn_eursasianActionPerformed(java.awt.event.ActionEvent evt) {
  641. lbl_imgBear.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/Johann Sebursian Bear.jpg")));
  642. //CHANGE TITLE TO EURASION BEAR
  643. lbl_titleBear.setText("Eurasion Bear");
  644. //CHANGES TO SUB CLASS EURASION BEHAVIORS
  645. lbl_info1BehaviorsBe.setText("- Conducting music");
  646. lbl_info2BehaviorsBe.setText("- Always active");
  647. lbl_info3BehaviorsBe.setText("- Playing the violin");
  648. //CHANGES TO SUB CLASS EURASION ATTRIBUTES
  649. lbl_info1AttributesBe.setText("- Puffy white hair");
  650. lbl_info2AttributesBe.setText("- Brown fur");
  651. lbl_info3AttributesBe.setText("- Clipped claws");
  652. }
  653.  
  654. private void btn_brownActionPerformed(java.awt.event.ActionEvent evt) {
  655. lbl_imgBear.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/Johannes Brown Bear.jpg")));
  656. //CHANGE TITLE TO BROWN BEAR
  657. lbl_titleBear.setText("Brown Bear");
  658. //CHANGES TO SUB CLASS BROWN BEHAVIORS
  659. lbl_info1BehaviorsBe.setText("- Plays piano gently despite his enormous paws");
  660. lbl_info2BehaviorsBe.setText("- Swims with the fish to get them to trust him before eating them");
  661. lbl_info3BehaviorsBe.setText("- Stands on small rocks in fear of alligators and sharks");
  662. //CHANGES TO SUB CLASS BROWN ATTRIBUTES
  663. lbl_info1AttributesBe.setText("- Brown furry creatures");
  664. lbl_info2AttributesBe.setText("- Fat (they need to lay off of the fish a little bit)");
  665. lbl_info3AttributesBe.setText("- Prideful of himself (he can play many, many instruments along with the piano)");
  666. }
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673. private void btn_frigateActionPerformed(java.awt.event.ActionEvent evt) {
  674. lbl_imgBird.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/Gabriel Fauré magnificent frigate bird.jpg")));
  675. //CHANGE TITLE TO FRIGATE BIRD
  676. lnl_titleBird.setText("Frigate Bird");
  677. //CHANGES TO SUB CLASS FRIGATE BEHAVIORS
  678. lbl_info1BehaviorsBi.setText("- Afraid of water (only eat flying fish)");
  679. lbl_info2BehaviorsBi.setText("- Jumps on the piano to create songs");
  680. lbl_info3BehaviorsBi.setText("- Chill in its beach nest and relax");
  681. //CHANGES TO SUB CLASS FRIGATE ATTRIBUTES
  682. lbl_info1AttributesBi.setText("- Bright red throat puffs out when it has an idea");
  683. lbl_info2AttributesBi.setText("- Long beak (all talk)");
  684. lbl_info3AttributesBi.setText("- Red demon eyes");
  685. }
  686.  
  687. private void btn_pigeonActionPerformed(java.awt.event.ActionEvent evt) {
  688. lbl_imgBird.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/Sergi Pigeon.jpg")));
  689. //CHANGE TITLE TO PIGEON BIRD
  690. lnl_titleBird.setText("Pigeon Bird");
  691. //CHANGES TO SUB CLASS PIGEON BEHAVIORS
  692. lbl_info1BehaviorsBi.setText("- Loves to take food from people walking in the street");
  693. lbl_info2BehaviorsBi.setText("- Creates round dents in cars with slicked hair and round heads");
  694. lbl_info3BehaviorsBi.setText("- Plays beautiful songs on the piano instead of chirping");
  695. //CHANGES TO SUB CLASS PIGEON ATTRIBUTES
  696. lbl_info1AttributesBi.setText("- Steady talons");
  697. lbl_info2AttributesBi.setText("- Green metallic feathers to reflect off negativity");
  698. lbl_info3AttributesBi.setText("- Slick hair");
  699. }
  700.  
  701. private void btn_puffinActionPerformed(java.awt.event.ActionEvent evt) {
  702. lbl_imgBird.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zoogui/Giacomo Antonio Domenico Michele Secondo Maria Puffin.jpg")));
  703. //CHANGE TITLE TO PUFFIN BIRD
  704. lnl_titleBird.setText("Puffin Bird");
  705. //CHANGES TO SUB CLASS PUFFIN BEHAVIORS
  706. lbl_info1BehaviorsBi.setText("- Dives into water to get inspiration for songs");
  707. lbl_info2BehaviorsBi.setText("- Combs mustache with claws");
  708. lbl_info3BehaviorsBi.setText("- Sings to annoy people");
  709. //CHANGES TO SUB CLASS PUFFIN ATTRIBUTES
  710. lbl_info1AttributesBi.setText("- Orange beak (called a copy bird)");
  711. lbl_info2AttributesBi.setText("- Black and white feathers");
  712. lbl_info3AttributesBi.setText("- Short and stubby as to contrast between its large voice");
  713. }
  714.  
  715. /**
  716. * @param args the command line arguments
  717. */
  718. public static void main(String args[]) {
  719. /* Set the Nimbus look and feel */
  720. //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  721. /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  722. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  723. */
  724. try {
  725. for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  726. if ("Nimbus".equals(info.getName())) {
  727. javax.swing.UIManager.setLookAndFeel(info.getClassName());
  728. break;
  729. }
  730. }
  731. } catch (ClassNotFoundException ex) {
  732. java.util.logging.Logger.getLogger(zoogui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  733. } catch (InstantiationException ex) {
  734. java.util.logging.Logger.getLogger(zoogui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  735. } catch (IllegalAccessException ex) {
  736. java.util.logging.Logger.getLogger(zoogui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  737. } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  738. java.util.logging.Logger.getLogger(zoogui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  739. }
  740. //</editor-fold>
  741.  
  742. /* Create and display the form */
  743. java.awt.EventQueue.invokeLater(new Runnable() {
  744. public void run() {
  745. new zoogui().setVisible(true);
  746. }
  747. });
  748. }
  749.  
  750. // Variables declaration - do not modify
  751. private javax.swing.JButton btn_bear;
  752. private javax.swing.JButton btn_bird;
  753. private javax.swing.JButton btn_brown;
  754. private javax.swing.JButton btn_capuchin;
  755. private javax.swing.JButton btn_eursasian;
  756. private javax.swing.JButton btn_frigate;
  757. private javax.swing.JButton btn_monkey;
  758. private javax.swing.JButton btn_patas;
  759. private javax.swing.JButton btn_pigeon;
  760. private javax.swing.JButton btn_puffin;
  761. private javax.swing.JButton btn_sloth;
  762. private javax.swing.JButton btn_tamarin;
  763. private javax.swing.JButton jButton1;
  764. private javax.swing.JLabel jLabel1;
  765. private javax.swing.JLabel jLabel2;
  766. private javax.swing.JLabel lbl_imgBear;
  767. private javax.swing.JLabel lbl_imgBird;
  768. private javax.swing.JLabel lbl_imgMonkey;
  769. private javax.swing.JLabel lbl_info1AttributesBe;
  770. private javax.swing.JLabel lbl_info1AttributesBi;
  771. private javax.swing.JLabel lbl_info1AttributesMo;
  772. private javax.swing.JLabel lbl_info1Bear;
  773. private javax.swing.JLabel lbl_info1BehaviorsBe;
  774. private javax.swing.JLabel lbl_info1BehaviorsBi;
  775. private javax.swing.JLabel lbl_info1BehaviorsMo;
  776. private javax.swing.JLabel lbl_info1Bird;
  777. private javax.swing.JLabel lbl_info1Monkey;
  778. private javax.swing.JLabel lbl_info2AttributesBe;
  779. private javax.swing.JLabel lbl_info2AttributesBi;
  780. private javax.swing.JLabel lbl_info2AttributesMo;
  781. private javax.swing.JLabel lbl_info2Bear;
  782. private javax.swing.JLabel lbl_info2BehaviorsBe;
  783. private javax.swing.JLabel lbl_info2BehaviorsBi;
  784. private javax.swing.JLabel lbl_info2BehaviorsMo;
  785. private javax.swing.JLabel lbl_info2Bird;
  786. private javax.swing.JLabel lbl_info2Monkey;
  787. private javax.swing.JLabel lbl_info3AttributesBe;
  788. private javax.swing.JLabel lbl_info3AttributesBi;
  789. private javax.swing.JLabel lbl_info3AttributesMo;
  790. private javax.swing.JLabel lbl_info3BehaviorsBe;
  791. private javax.swing.JLabel lbl_info3BehaviorsBi;
  792. private javax.swing.JLabel lbl_info3BehaviorsMo;
  793. private javax.swing.JLabel lbl_titleBear;
  794. private javax.swing.JLabel lbl_titleMonkey;
  795. private javax.swing.JLabel lnl_titleBird;
  796. private javax.swing.JPanel pnl_bear;
  797. private javax.swing.JPanel pnl_bird;
  798. private javax.swing.JPanel pnl_monkey;
  799. private javax.swing.JPanel pnl_opener;
  800. private javax.swing.JPanel pnl_superClass;
  801. // End of variables declaration
  802. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement