com.main.Gurajat.java Source code

Java tutorial

Introduction

Here is the source code for com.main.Gurajat.java

Source

/*
 * Created by JFormDesigner on Thu Mar 14 23:43:31 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 Gurajat extends JPanel {
    public Gurajat() {
        initComponents();
    }

    public static void createAndShowGUI() {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                Gurajat GUI = new Gurajat();
                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();
        panel2 = new JPanel();
        panel3 = new JPanel();
        label2 = new JLabel();
        label3 = new JLabel();
        label4 = new JLabel();
        panel6 = new JPanel();
        label13 = new JLabel();
        label14 = new JLabel();
        label15 = new JLabel();
        label16 = new JLabel();
        label17 = new JLabel();
        label8 = 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();
        label9 = 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();
        label10 = 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();
        label11 = 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();
        label12 = 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();
        panel4 = new JPanel();
        label5 = new JLabel();
        label6 = new JLabel();
        label7 = new JLabel();
        panel5 = 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", "default"));

            //---- label1 ----
            label1.setText("Gurajat 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));

        //======== panel2 ========
        {
            panel2.setLayout(new FormLayout("2*(default, $lcgap), default", "default"));

            //======== panel3 ========
            {
                panel3.setLayout(new FormLayout("default", "2*(default, $lgap), default"));

                //---- label2 ----
                label2.setIcon(new ImageIcon(getClass().getResource("/com/images/gujarat/guj1.jpg")));
                panel3.add(label2, CC.xy(1, 1));

                //---- label3 ----
                label3.setIcon(new ImageIcon(getClass().getResource("/com/images/gujarat/guj2.jpg")));
                panel3.add(label3, CC.xy(1, 3));

                //---- label4 ----
                label4.setIcon(new ImageIcon(getClass().getResource("/com/images/gujarat/guj3.jpg")));
                panel3.add(label4, CC.xy(1, 5));
            }
            panel2.add(panel3, CC.xy(1, 1));

            //======== panel6 ========
            {
                panel6.setBorder(LineBorder.createBlackLineBorder());
                panel6.setLayout(new FormLayout("5*(default, $lcgap), default", "5*(default, $lgap), default"));

                //---- label13 ----
                label13.setText("Ahmedabad");
                panel6.add(label13, CC.xy(3, 1));

                //---- label14 ----
                label14.setText("Vadodara");
                panel6.add(label14, CC.xy(5, 1));

                //---- label15 ----
                label15.setText("Porbandar");
                panel6.add(label15, CC.xy(7, 1));

                //---- label16 ----
                label16.setText("Junagadh");
                panel6.add(label16, CC.xy(9, 1));

                //---- label17 ----
                label17.setText("Saputara");
                panel6.add(label17, CC.xy(11, 1));

                //---- label8 ----
                label8.setText("PLACES TO VISIT");
                panel6.add(label8, CC.xy(1, 3));

                //======== scrollPane1 ========
                {

                    //---- editorPane1 ----
                    editorPane1.setEditable(false);
                    editorPane1.setText(
                            "Sabarmati Ashram,Adalaj Step-well,Auto World vintage Car Museum,Akshardham Temple,Kankaria Lake,Jama Masjiddada Hari,Rauza,Thor");
                    scrollPane1.setViewportView(editorPane1);
                }
                panel6.add(scrollPane1, CC.xy(3, 3));

                //======== scrollPane6 ========
                {

                    //---- editorPane6 ----
                    editorPane6.setEditable(false);
                    editorPane6.setText(
                            "Laxmi Vilas Palace,Baps Swaminarayan Mandir,Mahajan Palace,Maharaja Fatesingh Museum,Kabirvad,Narmada Canal,Kirti Stambh,Jubilee Baug");
                    scrollPane6.setViewportView(editorPane6);
                }
                panel6.add(scrollPane6, CC.xy(5, 3));

                //======== scrollPane11 ========
                {

                    //---- editorPane11 ----
                    editorPane11.setEditable(false);
                    editorPane11.setText(
                            "Kirti Mandir Temple,Pirbandar Beach,Krishna-Sudama Temple,Rani Baug Park,Tara mandir,Sartanji Choro,Ghumli,Huzoor Palace");
                    scrollPane11.setViewportView(editorPane11);
                }
                panel6.add(scrollPane11, CC.xy(7, 3));

                //======== scrollPane16 ========
                {

                    //---- editorPane16 ----
                    editorPane16.setEditable(false);
                    editorPane16.setText(
                            "Gir National Park Wildlife Sanctuary,Darbar Hall Museun,Sakkarbaug Zoo,Ashok Shilalekh,Uperkot Fort,Jain DerasarDataar Hills,Dattatreya Tempe,Wellington DamPatan Gate");
                    scrollPane16.setViewportView(editorPane16);
                }
                panel6.add(scrollPane16, CC.xy(9, 3));

                //======== scrollPane21 ========
                {

                    //---- editorPane21 ----
                    editorPane21.setEditable(false);
                    editorPane21.setText(
                            "Saputara Lake,Gira Waterfalls,Sunset Point,Tribal Museum,Lake Garden,Pandava Gufa,Hatgadh Fort");
                    scrollPane21.setViewportView(editorPane21);
                }
                panel6.add(scrollPane21, CC.xy(11, 3));

                //---- label9 ----
                label9.setText("HOTELS");
                panel6.add(label9, CC.xy(1, 5));

                //======== scrollPane2 ========
                {
                    scrollPane2.setAutoscrolls(true);

                    //---- editorPane2 ----
                    editorPane2.setEditable(false);
                    editorPane2.setText(
                            "Hotel Grand Ambience,Royal Orchid Central,The House of MG,Ista,The Fern,Park Plaza,Lemon Tree Hotel");
                    scrollPane2.setViewportView(editorPane2);
                }
                panel6.add(scrollPane2, CC.xy(3, 5));

                //======== scrollPane7 ========
                {
                    scrollPane7.setAutoscrolls(true);

                    //---- editorPane7 ----
                    editorPane7.setEditable(false);
                    editorPane7.setText(
                            "Royal Orchid  Central,Surya Palace Hotel,Gateay Hotel at Akota Gardens,Welcom hotel,Tansha Comfort Residency,The Oasis");
                    scrollPane7.setViewportView(editorPane7);
                }
                panel6.add(scrollPane7, CC.xy(5, 5));

                //======== scrollPane12 ========
                {
                    scrollPane12.setAutoscrolls(true);

                    //---- editorPane12 ----
                    editorPane12.setEditable(false);
                    editorPane12.setText(
                            "Hotel Lila,Hotel Kuber,Indraprasth,Hotel Harmony,Moon Palace,Natraj Hotel,Hotel President,Hotel Sheetal");
                    scrollPane12.setViewportView(editorPane12);
                }
                panel6.add(scrollPane12, CC.xy(7, 5));

                //======== scrollPane17 ========
                {
                    scrollPane17.setAutoscrolls(true);

                    //---- editorPane17 ----
                    editorPane17.setEditable(false);
                    editorPane17.setText(
                            "Lotus Hotel,Magico Do Mar,Hotel Vishala,Leo Resorts,Bhagyoday Palace Hotel,Hotel platinum");
                    scrollPane17.setViewportView(editorPane17);
                }
                panel6.add(scrollPane17, CC.xy(9, 5));

                //======== scrollPane22 ========
                {
                    scrollPane22.setAutoscrolls(true);

                    //---- editorPane22 ----
                    editorPane22.setEditable(false);
                    editorPane22.setText(
                            "Patang Lords Eco Inn,Chitrakoot Hill Resort,Toran Hill Resort,Vaity Ropeway Resort");
                    scrollPane22.setViewportView(editorPane22);
                }
                panel6.add(scrollPane22, CC.xy(11, 5));

                //---- label10 ----
                label10.setText("RESTAURANT");
                panel6.add(label10, CC.xy(1, 7));

                //======== scrollPane3 ========
                {

                    //---- editorPane3 ----
                    editorPane3.setEditable(false);
                    editorPane3.setText(
                            "Agashiye,Vishalla,Swati Snacks,Awadh Puri,Zen Cafe,Havmor,Atithi,Seva Caf\u00e9");
                    scrollPane3.setViewportView(editorPane3);
                }
                panel6.add(scrollPane3, CC.xy(3, 7));

                //======== scrollPane8 ========
                {

                    //---- editorPane8 ----
                    editorPane8.setEditable(false);
                    editorPane8
                            .setText("Kai Asia,Offside Lounge,22nd Parallel,Peshawri,Little Italy,Barbeque Nation");
                    scrollPane8.setViewportView(editorPane8);
                }
                panel6.add(scrollPane8, CC.xy(5, 7));

                //======== scrollPane13 ========
                {

                    //---- editorPane13 ----
                    editorPane13.setEditable(false);
                    editorPane13.setText("Swagat Restaurant");
                    scrollPane13.setViewportView(editorPane13);
                }
                panel6.add(scrollPane13, CC.xy(7, 7));

                //======== scrollPane18 ========
                {

                    //---- editorPane18 ----
                    editorPane18.setEditable(false);
                    editorPane18.setText("Geeta Lodge,Rajbhog Restaurant");
                    scrollPane18.setViewportView(editorPane18);
                }
                panel6.add(scrollPane18, CC.xy(9, 7));

                //======== scrollPane23 ========
                {

                    //---- editorPane23 ----
                    editorPane23.setEditable(false);
                    editorPane23.setText("Uday Hill Resto-Bar,");
                    scrollPane23.setViewportView(editorPane23);
                }
                panel6.add(scrollPane23, CC.xy(11, 7));

                //---- label11 ----
                label11.setText("CLIMATE");
                panel6.add(label11, CC.xy(1, 9));

                //======== scrollPane4 ========
                {

                    //---- editorPane4 ----
                    editorPane4.setEditable(false);
                    editorPane4.setText("Semi-arid");
                    scrollPane4.setViewportView(editorPane4);
                }
                panel6.add(scrollPane4, CC.xy(3, 9));

                //======== scrollPane9 ========
                {

                    //---- editorPane9 ----
                    editorPane9.setEditable(false);
                    editorPane9.setText("Dry");
                    scrollPane9.setViewportView(editorPane9);
                }
                panel6.add(scrollPane9, CC.xy(5, 9));

                //======== scrollPane14 ========
                {

                    //---- editorPane14 ----
                    editorPane14.setEditable(false);
                    editorPane14.setText("Moderate");
                    scrollPane14.setViewportView(editorPane14);
                }
                panel6.add(scrollPane14, CC.xy(7, 9));

                //======== scrollPane19 ========
                {

                    //---- editorPane19 ----
                    editorPane19.setEditable(false);
                    editorPane19.setText("Dry and Scanty Rainfall");
                    scrollPane19.setViewportView(editorPane19);
                }
                panel6.add(scrollPane19, CC.xy(9, 9));

                //======== scrollPane24 ========
                {

                    //---- editorPane24 ----
                    editorPane24.setEditable(false);
                    editorPane24.setText("Pleasant");
                    scrollPane24.setViewportView(editorPane24);
                }
                panel6.add(scrollPane24, CC.xy(11, 9));

                //---- label12 ----
                label12.setText("SPECIALITY");
                panel6.add(label12, CC.xy(1, 11));

                //======== scrollPane5 ========
                {

                    //---- editorPane5 ----
                    editorPane5.setEditable(false);
                    editorPane5.setText("Museums,Hospitals");
                    scrollPane5.setViewportView(editorPane5);
                }
                panel6.add(scrollPane5, CC.xy(3, 11));

                //======== scrollPane10 ========
                {

                    //---- editorPane10 ----
                    editorPane10.setEditable(false);
                    editorPane10.setText("Textiles,Dhokla");
                    scrollPane10.setViewportView(editorPane10);
                }
                panel6.add(scrollPane10, CC.xy(5, 11));

                //======== scrollPane15 ========
                {

                    //---- editorPane15 ----
                    editorPane15.setEditable(false);
                    editorPane15.setText("Khajali,Sweets");
                    scrollPane15.setViewportView(editorPane15);
                }
                panel6.add(scrollPane15, CC.xy(7, 11));

                //======== scrollPane20 ========
                {

                    //---- editorPane20 ----
                    editorPane20.setEditable(false);
                    editorPane20.setText("Parks,Museums");
                    scrollPane20.setViewportView(editorPane20);
                }
                panel6.add(scrollPane20, CC.xy(9, 11));

                //======== scrollPane25 ========
                {

                    //---- editorPane25 ----
                    editorPane25.setText("Hill Station,Park");
                    scrollPane25.setViewportView(editorPane25);
                }
                panel6.add(scrollPane25, CC.xy(11, 11));
            }
            panel2.add(panel6, CC.xy(3, 1));

            //======== panel4 ========
            {
                panel4.setLayout(new FormLayout("default", "2*(default, $lgap), default"));

                //---- label5 ----
                label5.setIcon(new ImageIcon(getClass().getResource("/com/images/gujarat/gujmap.jpg")));
                panel4.add(label5, CC.xy(1, 1));

                //---- label6 ----
                label6.setIcon(new ImageIcon(getClass().getResource("/com/images/gujarat/guj4.jpg")));
                panel4.add(label6, CC.xy(1, 3));

                //---- label7 ----
                label7.setIcon(new ImageIcon(getClass().getResource("/com/images/gujarat/guj5.jpg")));
                panel4.add(label7, CC.xy(1, 5));
            }
            panel2.add(panel4, CC.xy(5, 1));
        }
        add(panel2, CC.xy(1, 2));

        //======== panel5 ========
        {
            panel5.setLayout(new FormLayout("default, $lcgap, default", "default"));

            //---- button1 ----
            button1.setText("Go Back To Main Menu");
            panel5.add(button1, CC.xy(1, 1));
        }
        add(panel5, CC.xy(1, 4));
        // 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 panel2;
    private JPanel panel3;
    private JLabel label2;
    private JLabel label3;
    private JLabel label4;
    private JPanel panel6;
    private JLabel label13;
    private JLabel label14;
    private JLabel label15;
    private JLabel label16;
    private JLabel label17;
    private JLabel label8;
    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 label9;
    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 label10;
    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 label11;
    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 label12;
    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 panel4;
    private JLabel label5;
    private JLabel label6;
    private JLabel label7;
    private JPanel panel5;
    private JButton button1;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}