Java tutorial
/* * Created by JFormDesigner on Thu Mar 14 21:10:58 IST 2013 */ package com.main; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; import javax.swing.border.*; import com.jgoodies.forms.factories.*; import com.jgoodies.forms.layout.*; /** * @author Anjali Shinde */ public class KeralaPage extends JPanel { public KeralaPage() { initComponents(); } public static void createAndShowGUI() { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { KeralaPage GUI = new KeralaPage(); JFrame frame = new JFrame(); frame.setContentPane(GUI); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setExtendedState(JFrame.MAXIMIZED_BOTH); } }); } public static void main(String[] args) { createAndShowGUI(); } private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Anjali Shinde panel1 = new JPanel(); label1 = new JLabel(); panel5 = new JPanel(); panel6 = new JPanel(); label10 = new JLabel(); label11 = new JLabel(); label12 = new JLabel(); panel9 = new JPanel(); label22 = new JLabel(); label23 = new JLabel(); label24 = new JLabel(); label25 = new JLabel(); label21 = new JLabel(); label16 = new JLabel(); scrollPane1 = new JScrollPane(); editorPane1 = new JEditorPane(); scrollPane6 = new JScrollPane(); editorPane6 = new JEditorPane(); scrollPane11 = new JScrollPane(); editorPane11 = new JEditorPane(); scrollPane16 = new JScrollPane(); editorPane16 = new JEditorPane(); scrollPane21 = new JScrollPane(); editorPane21 = new JEditorPane(); label17 = new JLabel(); scrollPane2 = new JScrollPane(); editorPane2 = new JEditorPane(); scrollPane7 = new JScrollPane(); editorPane7 = new JEditorPane(); scrollPane12 = new JScrollPane(); editorPane12 = new JEditorPane(); scrollPane17 = new JScrollPane(); editorPane17 = new JEditorPane(); scrollPane22 = new JScrollPane(); editorPane22 = new JEditorPane(); label18 = new JLabel(); scrollPane3 = new JScrollPane(); editorPane3 = new JEditorPane(); scrollPane8 = new JScrollPane(); editorPane8 = new JEditorPane(); scrollPane13 = new JScrollPane(); editorPane13 = new JEditorPane(); scrollPane18 = new JScrollPane(); editorPane18 = new JEditorPane(); scrollPane23 = new JScrollPane(); editorPane23 = new JEditorPane(); label19 = new JLabel(); scrollPane4 = new JScrollPane(); editorPane4 = new JEditorPane(); scrollPane9 = new JScrollPane(); editorPane9 = new JEditorPane(); scrollPane14 = new JScrollPane(); editorPane14 = new JEditorPane(); scrollPane19 = new JScrollPane(); editorPane19 = new JEditorPane(); scrollPane24 = new JScrollPane(); editorPane24 = new JEditorPane(); label20 = new JLabel(); scrollPane5 = new JScrollPane(); editorPane5 = new JEditorPane(); scrollPane10 = new JScrollPane(); editorPane10 = new JEditorPane(); scrollPane15 = new JScrollPane(); editorPane15 = new JEditorPane(); scrollPane20 = new JScrollPane(); editorPane20 = new JEditorPane(); scrollPane25 = new JScrollPane(); editorPane25 = new JEditorPane(); panel7 = new JPanel(); label13 = new JLabel(); label14 = new JLabel(); label15 = new JLabel(); panel8 = new JPanel(); button1 = new JButton(); //======== this ======== // JFormDesigner evaluation mark setBorder( new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), getBorder())); addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); setLayout(new FormLayout("default:grow", "2*(default, $lgap), default")); //======== panel1 ======== { panel1.setLayout(new FormLayout("default:grow", "pref")); //---- label1 ---- label1.setText("Kerala Tourism"); label1.setFont(new Font("Tahoma", Font.BOLD, 24)); panel1.add(label1, CC.xy(1, 1, CC.CENTER, CC.CENTER)); } add(panel1, CC.xy(1, 1)); //======== panel5 ======== { panel5.setLayout(new FormLayout("2*(default, $lcgap), default", "default")); //======== panel6 ======== { panel6.setLayout(new FormLayout("default:grow", "2*(default, $lgap), default")); //---- label10 ---- label10.setIcon(new ImageIcon(getClass().getResource("/com/images/kerala/ker2.jpg"))); panel6.add(label10, CC.xy(1, 1)); //---- label11 ---- label11.setIcon(new ImageIcon(getClass().getResource("/com/images/kerala/ker1.jpg"))); panel6.add(label11, CC.xy(1, 3)); //---- label12 ---- label12.setIcon(new ImageIcon(getClass().getResource("/com/images/kerala/ker3.jpg"))); panel6.add(label12, CC.xy(1, 5)); } panel5.add(panel6, CC.xy(1, 1)); //======== panel9 ======== { panel9.setBorder(LineBorder.createBlackLineBorder()); panel9.setLayout(new FormLayout("5*(default:grow, $lcgap), 57dlu:grow", "5*(fill:default:grow, $lgap), fill:default:grow")); //---- label22 ---- label22.setText("Kochi(Cochin)"); panel9.add(label22, CC.xy(3, 1)); //---- label23 ---- label23.setText("Trivandrum"); panel9.add(label23, CC.xy(5, 1)); //---- label24 ---- label24.setText("Munnar"); panel9.add(label24, CC.xy(7, 1)); //---- label25 ---- label25.setText("Thrissur"); panel9.add(label25, CC.xy(9, 1)); //---- label21 ---- label21.setText("Alappuzha"); panel9.add(label21, CC.xy(11, 1)); //---- label16 ---- label16.setText("PLACES TO VISIT"); panel9.add(label16, CC.xy(1, 3)); //======== scrollPane1 ======== { //---- editorPane1 ---- editorPane1.setEditable(false); editorPane1.setText( "Wonderla Amusement Park,Folklore Theatre & Museum,Kerala Backwaters,Fort Kochi,Mattancherry,Santa Cruz Basilica,Jew Town,Princess Street,Cherai Beach"); scrollPane1.setViewportView(editorPane1); } panel9.add(scrollPane1, CC.xy(3, 3)); //======== scrollPane6 ======== { //---- editorPane6 ---- editorPane6.setEditable(false); editorPane6.setText( "Poonar Island,Shri Padmanabhaswamy Temple,Museum Complex,Thiruvanthapuram Zoo,Napier Art Museum & gallery,Vizhinjam Lighthouse,Samudra Beach"); scrollPane6.setViewportView(editorPane6); } panel9.add(scrollPane6, CC.xy(5, 3)); //======== scrollPane11 ======== { //---- editorPane11 ---- editorPane11.setEditable(false); editorPane11.setText( "Tea Gardens,Fun Forest Adventure Park,Top Station,CSI Christ Church,Attukal Waterfals,Anamudi Peak,Mattupetty Dam,Rajamalai National Park,Lakkam Waterfalls"); scrollPane11.setViewportView(editorPane11); } panel9.add(scrollPane11, CC.xy(7, 3)); //======== scrollPane16 ======== { //---- editorPane16 ---- editorPane16.setEditable(false); editorPane16.setText( "Athirampally Waterfalls,Vadakkunnathan Temple,Kauthuka Park,Koodalmanikyam temple,Poomala Dam,Vilagan Hills"); scrollPane16.setViewportView(editorPane16); } panel9.add(scrollPane16, CC.xy(9, 3)); //======== scrollPane21 ======== { //---- editorPane21 ---- editorPane21.setEditable(false); editorPane21.setText( "Kerala Backwaters,Marari Beach,St.Mary's Forane Church,Secretbeach,Revi Karunakaran museum,Alappuzha Beach,Edathua Church"); scrollPane21.setViewportView(editorPane21); } panel9.add(scrollPane21, CC.xy(11, 3)); //---- label17 ---- label17.setText("HOTELS"); panel9.add(label17, CC.xy(1, 5)); //======== scrollPane2 ======== { //---- editorPane2 ---- editorPane2.setEditable(false); editorPane2.setText( "Old Harbour Hotel,Sajhome,Vivanta By Taj,Green Woods,Ann's Residency,Le Colonial,Hotel Arches,Brunton Boatyard,Fort House"); scrollPane2.setViewportView(editorPane2); } panel9.add(scrollPane2, CC.xy(3, 5)); //======== scrollPane7 ======== { //---- editorPane7 ---- editorPane7.setEditable(false); editorPane7.setText( "Amrutham,Vivanta by Taj,Coconut Bay Beach Resort,Windsor Rajadhani,SP Grand Days,Sea Shore"); scrollPane7.setViewportView(editorPane7); } panel9.add(scrollPane7, CC.xy(5, 5)); //======== scrollPane12 ======== { //---- editorPane12 ---- editorPane12.setEditable(false); editorPane12.setText( "Grand Plaza,camp Noel,Aranyaka Resort,Elysium Garden Hill Resorts,Windermere Estate,The Tall Trees"); scrollPane12.setViewportView(editorPane12); } panel9.add(scrollPane12, CC.xy(7, 5)); //======== scrollPane17 ======== { //---- editorPane17 ---- editorPane17.setEditable(false); editorPane17.setText( "Nattika Beach Resort,niya regency,River Retreat,Joys Palace,Ashoka Inn,Ayuryogashram,Hotel Peninsula"); scrollPane17.setViewportView(editorPane17); } panel9.add(scrollPane17, CC.xy(9, 5)); //======== scrollPane22 ======== { //---- editorPane22 ---- editorPane22.setEditable(false); editorPane22.setText( "Motty's Homestay,Citrus Retreats Alleppey,Ashtamudi homestay,Punnamada Resort,Pooppallys Heritage Home,Casamaria beach Resort"); scrollPane22.setViewportView(editorPane22); } panel9.add(scrollPane22, CC.xy(11, 5)); //---- label18 ---- label18.setText("RESTAURANT"); panel9.add(label18, CC.xy(1, 7)); //======== scrollPane3 ======== { //---- editorPane3 ---- editorPane3.setEditable(false); editorPane3.setText( "Kashi,Oceanos Restaurant,Krishna Caf\u00e9,Tokyo Bay,Solar Caf\u00e9,Fort house Restaurant"); scrollPane3.setViewportView(editorPane3); } panel9.add(scrollPane3, CC.xy(3, 7)); //======== scrollPane8 ======== { //---- editorPane8 ---- editorPane8.setEditable(false); editorPane8.setText( "Cherries & Berries,Bait,Villa maya,Arul Jyothi,Jasmin Bay,Third Rock Caf\u00e9,Indian Coffee House,Zam Zam"); scrollPane8.setViewportView(editorPane8); } panel9.add(scrollPane8, CC.xy(5, 7)); //======== scrollPane13 ======== { scrollPane13.setEnabled(false); //---- editorPane13 ---- editorPane13.setEditable(false); editorPane13.setText( "Saravana Bhavan,Mayabazar,Copper castle restaurant,Rapsy Restaurant,Sarath Inn,Farmyard,Galaxy Reataurant"); scrollPane13.setViewportView(editorPane13); } panel9.add(scrollPane13, CC.xy(7, 7)); //======== scrollPane18 ======== { //---- editorPane18 ---- editorPane18.setEditable(false); editorPane18.setText( "Hotel Bharat,Indian Wok,Annalakshmi,Reach Us Hotels,Copper Spoon,Pathans,Joy Palace"); scrollPane18.setViewportView(editorPane18); } panel9.add(scrollPane18, CC.xy(9, 7)); //======== scrollPane23 ======== { //---- editorPane23 ---- editorPane23.setEditable(false); editorPane23.setText( "Dreamers Cafe and Restaurant,Thaff,Indian Coffee House,Kream Korner,Hot Dishes,Royel Park Hotel,Chakara Restaurant"); scrollPane23.setViewportView(editorPane23); } panel9.add(scrollPane23, CC.xy(11, 7)); //---- label19 ---- label19.setText("CLIMATE"); panel9.add(label19, CC.xy(1, 9)); //======== scrollPane4 ======== { //---- editorPane4 ---- editorPane4.setEditable(false); editorPane4.setText("Hot and Humid"); scrollPane4.setViewportView(editorPane4); } panel9.add(scrollPane4, CC.xy(3, 9)); //======== scrollPane9 ======== { //---- editorPane9 ---- editorPane9.setEditable(false); editorPane9.setText("Hot and Humid"); scrollPane9.setViewportView(editorPane9); } panel9.add(scrollPane9, CC.xy(5, 9)); //======== scrollPane14 ======== { //---- editorPane14 ---- editorPane14.setEditable(false); editorPane14.setText("Cold"); scrollPane14.setViewportView(editorPane14); } panel9.add(scrollPane14, CC.xy(7, 9)); //======== scrollPane19 ======== { //---- editorPane19 ---- editorPane19.setEditable(false); editorPane19.setText("Cold"); scrollPane19.setViewportView(editorPane19); } panel9.add(scrollPane19, CC.xy(9, 9)); //======== scrollPane24 ======== { //---- editorPane24 ---- editorPane24.setEditable(false); editorPane24.setText("Hot"); scrollPane24.setViewportView(editorPane24); } panel9.add(scrollPane24, CC.xy(11, 9)); //---- label20 ---- label20.setText("SPECIALITY"); panel9.add(label20, CC.xy(1, 11)); //======== scrollPane5 ======== { //---- editorPane5 ---- editorPane5.setEditable(false); editorPane5.setText("Ship Building"); scrollPane5.setViewportView(editorPane5); } panel9.add(scrollPane5, CC.xy(3, 11)); //======== scrollPane10 ======== { //---- editorPane10 ---- editorPane10.setEditable(false); editorPane10.setText("Temples, Beaches"); scrollPane10.setViewportView(editorPane10); } panel9.add(scrollPane10, CC.xy(5, 11)); //======== scrollPane15 ======== { //---- editorPane15 ---- editorPane15.setEditable(false); editorPane15.setText("Tea Gardens"); scrollPane15.setViewportView(editorPane15); } panel9.add(scrollPane15, CC.xy(7, 11)); //======== scrollPane20 ======== { //---- editorPane20 ---- editorPane20.setEditable(false); editorPane20.setText("Elephant Rides, Spice Garden"); scrollPane20.setViewportView(editorPane20); } panel9.add(scrollPane20, CC.xy(9, 11)); //======== scrollPane25 ======== { //---- editorPane25 ---- editorPane25.setEditable(false); editorPane25.setText("Fish,Houseboats,Backwaters"); scrollPane25.setViewportView(editorPane25); } panel9.add(scrollPane25, CC.xy(11, 11)); } panel5.add(panel9, CC.xy(3, 1, CC.CENTER, CC.CENTER)); //======== panel7 ======== { panel7.setLayout(new FormLayout("default:grow", "2*(default, $lgap), default")); //---- label13 ---- label13.setIcon(new ImageIcon(getClass().getResource("/com/images/kerala/ker4.jpg"))); panel7.add(label13, CC.xy(1, 1)); //---- label14 ---- label14.setIcon(new ImageIcon(getClass().getResource("/com/images/kerala/ker5.jpg"))); panel7.add(label14, CC.xy(1, 3)); //---- label15 ---- label15.setIcon(new ImageIcon(getClass().getResource("/com/images/kerala/kermap.jpg"))); panel7.add(label15, CC.xy(1, 5)); } panel5.add(panel7, CC.xy(5, 1)); } add(panel5, CC.xy(1, 3)); //======== panel8 ======== { panel8.setLayout(new FormLayout("default, $lcgap, default", "default")); //---- button1 ---- button1.setText("Go Back To Main Menu"); panel8.add(button1, CC.xy(3, 1)); } add(panel8, CC.xy(1, 5)); // JFormDesigner - End of component initialization //GEN-END:initComponents button1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { MainPageView page = new MainPageView(); page.createAndShowGUI(); } }); } // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables // Generated using JFormDesigner Evaluation license - Anjali Shinde private JPanel panel1; private JLabel label1; private JPanel panel5; private JPanel panel6; private JLabel label10; private JLabel label11; private JLabel label12; private JPanel panel9; private JLabel label22; private JLabel label23; private JLabel label24; private JLabel label25; private JLabel label21; private JLabel label16; private JScrollPane scrollPane1; private JEditorPane editorPane1; private JScrollPane scrollPane6; private JEditorPane editorPane6; private JScrollPane scrollPane11; private JEditorPane editorPane11; private JScrollPane scrollPane16; private JEditorPane editorPane16; private JScrollPane scrollPane21; private JEditorPane editorPane21; private JLabel label17; private JScrollPane scrollPane2; private JEditorPane editorPane2; private JScrollPane scrollPane7; private JEditorPane editorPane7; private JScrollPane scrollPane12; private JEditorPane editorPane12; private JScrollPane scrollPane17; private JEditorPane editorPane17; private JScrollPane scrollPane22; private JEditorPane editorPane22; private JLabel label18; private JScrollPane scrollPane3; private JEditorPane editorPane3; private JScrollPane scrollPane8; private JEditorPane editorPane8; private JScrollPane scrollPane13; private JEditorPane editorPane13; private JScrollPane scrollPane18; private JEditorPane editorPane18; private JScrollPane scrollPane23; private JEditorPane editorPane23; private JLabel label19; private JScrollPane scrollPane4; private JEditorPane editorPane4; private JScrollPane scrollPane9; private JEditorPane editorPane9; private JScrollPane scrollPane14; private JEditorPane editorPane14; private JScrollPane scrollPane19; private JEditorPane editorPane19; private JScrollPane scrollPane24; private JEditorPane editorPane24; private JLabel label20; private JScrollPane scrollPane5; private JEditorPane editorPane5; private JScrollPane scrollPane10; private JEditorPane editorPane10; private JScrollPane scrollPane15; private JEditorPane editorPane15; private JScrollPane scrollPane20; private JEditorPane editorPane20; private JScrollPane scrollPane25; private JEditorPane editorPane25; private JPanel panel7; private JLabel label13; private JLabel label14; private JLabel label15; private JPanel panel8; private JButton button1; // JFormDesigner - End of variables declaration //GEN-END:variables }