Java tutorial
/* * Created by JFormDesigner on Thu Mar 14 22:36:02 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 RajasthanView extends JPanel { public RajasthanView() { initComponents(); } public static void createAndShowGUI() { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { RajasthanView GUI = new RajasthanView(); 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(); panel5 = 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(); scrollPane24 = new JScrollPane(); editorPane23 = 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(); editorPane22 = 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(); scrollPane25 = 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(); scrollPane26 = new JScrollPane(); editorPane25 = new JEditorPane(); panel4 = new JPanel(); label5 = new JLabel(); label6 = new JLabel(); label7 = new JLabel(); panel6 = 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("Rajasthan 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:grow", "2*(fill:default:grow, $lgap), fill:default:grow")); //---- label2 ---- label2.setIcon(new ImageIcon(getClass().getResource("/com/images/rajasthan/raj1.jpg"))); panel3.add(label2, CC.xy(1, 1)); //---- label3 ---- label3.setIcon(new ImageIcon(getClass().getResource("/com/images/rajasthan/raj2.jpg"))); panel3.add(label3, CC.xy(1, 3)); //---- label4 ---- label4.setIcon(new ImageIcon(getClass().getResource("/com/images/rajasthan/raj3.jpg"))); panel3.add(label4, CC.xy(1, 5)); } panel2.add(panel3, CC.xy(1, 1)); //======== panel5 ======== { panel5.setBorder(LineBorder.createBlackLineBorder()); panel5.setLayout( new FormLayout("default:grow, 5*($lcgap, default)", "5*(default, $lgap), default")); //---- label13 ---- label13.setText("Jaipur"); panel5.add(label13, CC.xy(3, 1)); //---- label14 ---- label14.setText("Jodhpur"); panel5.add(label14, CC.xy(5, 1)); //---- label15 ---- label15.setText("Udaipur"); panel5.add(label15, CC.xy(7, 1)); //---- label16 ---- label16.setText("Mount Abu"); panel5.add(label16, CC.xy(9, 1)); //---- label17 ---- label17.setText("Bharatpur"); panel5.add(label17, CC.xy(11, 1)); //---- label8 ---- label8.setText("PLACES TO VISIT"); panel5.add(label8, CC.xy(1, 3)); //======== scrollPane1 ======== { //---- editorPane1 ---- editorPane1.setEditable(false); editorPane1.setText( "Elefantastic,Amber Fort and Palace,Anokhi Museum Of Hand Printing,Abhaneri Step Well,Govind Devji Temple,Shesh Mahal,Jantar Mantar,Birla Mandir Temple,Hawa MahalJaigarh Fort"); scrollPane1.setViewportView(editorPane1); } panel5.add(scrollPane1, CC.xy(3, 3)); //======== scrollPane6 ======== { //---- editorPane6 ---- editorPane6.setEditable(false); editorPane6.setText( "Meherangarh Fort,Spice Parardise,Jaswant Thada,Shri Ganesh Temple,Kailana Lake,Clock Tower,Phalodi Fort,Zenana MahalMahamandir"); scrollPane6.setViewportView(editorPane6); } panel5.add(scrollPane6, CC.xy(5, 3)); //======== scrollPane11 ======== { //---- editorPane11 ---- editorPane11.setEditable(false); editorPane11.setText( "Jain Temple,Kumbhalgarh Fort,Lake Pichhola,Bagore Ki haveli,City palace,Eklingji temple,jaisamand Lake,Jagdish temple,Lake Fatehsagar,Jag Mandir"); scrollPane11.setViewportView(editorPane11); } panel5.add(scrollPane11, CC.xy(7, 3)); //======== scrollPane16 ======== { //---- editorPane16 ---- editorPane16.setEditable(false); editorPane16.setText( "Dilwar Jain Temples,Mount Abu,Sunset Point,Nakki Lake,Adhar Devi Temple,Achalgarh Fort,Mount Abu Wildlife Sanctuary"); scrollPane16.setViewportView(editorPane16); } panel5.add(scrollPane16, CC.xy(9, 3)); //======== scrollPane21 ======== { //---- editorPane21 ---- editorPane21.setEditable(false); editorPane21.setText( "Keoladeo National Park,Keoladeo Ghana Bird,Deeg Palace,Government Museum,Lohagarh Fort,Shergarh Fort"); scrollPane21.setViewportView(editorPane21); } panel5.add(scrollPane21, CC.xy(11, 3)); //---- label9 ---- label9.setText("HOTELS"); panel5.add(label9, CC.xy(1, 5)); //======== scrollPane2 ======== { //---- editorPane2 ---- editorPane2.setEditable(false); editorPane2.setText( "The Oberoi Rajvilas,Arya Niwas,Royal Heritage Haveli,Jas Vilas,Devi Niketan,Hotel Pearl Palace,Barwara Kothi,Hotel Meghniwas,Hotel Anuraag Villa"); scrollPane2.setViewportView(editorPane2); } panel5.add(scrollPane2, CC.xy(3, 5)); //======== scrollPane7 ======== { //---- editorPane7 ---- editorPane7.setEditable(false); editorPane7.setText( "Umaid Bhawan Palace,Ratan Vilas,Chandelao Garh,Mandore guest House,Devi Bhawan,Haveli Inn Pal,Hari Mahl,Dhillon House"); scrollPane7.setViewportView(editorPane7); } panel5.add(scrollPane7, CC.xy(5, 5)); //======== scrollPane12 ======== { //---- editorPane12 ---- editorPane12.setEditable(false); editorPane12.setText( "Taj Lake Palace,The Oberoi Udaivilas,Leela Palace,Trident,Jaiwana Haveli,Devra,Mahendra Prakash,Amantra Comfort Hotel"); scrollPane12.setViewportView(editorPane12); } panel5.add(scrollPane12, CC.xy(7, 5)); //======== scrollPane17 ======== { //---- editorPane17 ---- editorPane17.setEditable(false); editorPane17.setText( "Ratan Villas,Hotel Vinayak,Hotel Hilltone,Hillock,Cama Rajputana club Resort,Chacha Inn,Hotel Swagat,Hotel Savera Palace,The Jaipur House,Hotel Vishram,Aranya Village Hill Resort"); scrollPane17.setViewportView(editorPane17); } panel5.add(scrollPane17, CC.xy(9, 5)); //======== scrollPane24 ======== { //---- editorPane23 ---- editorPane23.setEditable(false); editorPane23.setText( "Swaraj Resorts,The Bagh Resort,Hotel Surys Vilas Palace,Laxmi Vilas Palace Hotel,Hotel Sunbird,Evergreen Guest House,Kadamb Kunj Resort"); scrollPane24.setViewportView(editorPane23); } panel5.add(scrollPane24, CC.xy(11, 5)); //---- label10 ---- label10.setText("RESTAURANT"); panel5.add(label10, CC.xy(1, 7)); //======== scrollPane3 ======== { //---- editorPane3 ---- editorPane3.setEditable(false); editorPane3.setText( "Kalyan Restaurant,Nibs the chocolate workshop,Anokhi Cafe,Chitra Cafe,Suvarna Mahal,BMB,Peshawari,Pinxx Restaurant"); scrollPane3.setViewportView(editorPane3); } panel5.add(scrollPane3, CC.xy(3, 7)); //======== scrollPane8 ======== { //---- editorPane8 ---- editorPane8.setEditable(false); editorPane8.setText( "Gypsy Restaurant,Rhythm,Darikhana at RAAS,Hanuwant Mahal,Indiqui,Jhankar Choti Haveli,Hem's Delicious Food"); scrollPane8.setViewportView(editorPane8); } panel5.add(scrollPane8, CC.xy(5, 7)); //======== scrollPane13 ======== { //---- editorPane13 ---- editorPane13.setEditable(false); editorPane13.setText( "Lake Palace Hotel,Raas Leela,Pushkar's Cafe,Ambrai,Natraj Lodge,Cafe Isaac,Navidya Restaurant"); scrollPane13.setViewportView(editorPane13); } panel5.add(scrollPane13, CC.xy(7, 7)); //======== scrollPane18 ======== { //---- editorPane18 ---- editorPane18.setEditable(false); editorPane18.setText( "Cafe Shikibo,Mukberry Tree Restaurant,jaipur Palace,Cafe Coffee Day,Dawat Restaurant,King's Food,Zaiqa"); scrollPane18.setViewportView(editorPane18); } panel5.add(scrollPane18, CC.xy(9, 7)); //======== scrollPane23 ======== { //---- editorPane22 ---- editorPane22.setEditable(false); editorPane22.setText( "Atithi Restaurant,Ravia Poolside and Rooftop Restaurant,Gulmohar Restaurant,Ruchi Restaurant"); scrollPane23.setViewportView(editorPane22); } panel5.add(scrollPane23, CC.xy(11, 7)); //---- label11 ---- label11.setText("CLIMATE"); panel5.add(label11, CC.xy(1, 9)); //======== scrollPane4 ======== { //---- editorPane4 ---- editorPane4.setEditable(false); editorPane4.setText("Moderate"); scrollPane4.setViewportView(editorPane4); } panel5.add(scrollPane4, CC.xy(3, 9)); //======== scrollPane9 ======== { //---- editorPane9 ---- editorPane9.setEditable(false); editorPane9.setText("Hot and Cold"); scrollPane9.setViewportView(editorPane9); } panel5.add(scrollPane9, CC.xy(5, 9)); //======== scrollPane14 ======== { //---- editorPane14 ---- editorPane14.setEditable(false); editorPane14.setText("Dry,Hot,Cold"); scrollPane14.setViewportView(editorPane14); } panel5.add(scrollPane14, CC.xy(7, 9)); //======== scrollPane19 ======== { //---- editorPane19 ---- editorPane19.setEditable(false); editorPane19.setText("Moderate"); scrollPane19.setViewportView(editorPane19); } panel5.add(scrollPane19, CC.xy(9, 9)); //======== scrollPane25 ======== { //---- editorPane24 ---- editorPane24.setEditable(false); editorPane24.setText("Hot and Cold"); scrollPane25.setViewportView(editorPane24); } panel5.add(scrollPane25, CC.xy(11, 9)); //---- label12 ---- label12.setText("SPECIALITY"); panel5.add(label12, CC.xy(1, 11)); //======== scrollPane5 ======== { //---- editorPane5 ---- editorPane5.setEditable(false); editorPane5.setText("Sweets"); scrollPane5.setViewportView(editorPane5); } panel5.add(scrollPane5, CC.xy(3, 11)); //======== scrollPane10 ======== { //---- editorPane10 ---- editorPane10.setEditable(false); editorPane10.setText("Fort,Sweets"); scrollPane10.setViewportView(editorPane10); } panel5.add(scrollPane10, CC.xy(5, 11)); //======== scrollPane15 ======== { //---- editorPane15 ---- editorPane15.setEditable(false); editorPane15.setText("Temples"); scrollPane15.setViewportView(editorPane15); } panel5.add(scrollPane15, CC.xy(7, 11)); //======== scrollPane20 ======== { //---- editorPane20 ---- editorPane20.setEditable(false); editorPane20.setText("Hill Station"); scrollPane20.setViewportView(editorPane20); } panel5.add(scrollPane20, CC.xy(9, 11)); //======== scrollPane26 ======== { //---- editorPane25 ---- editorPane25.setEditable(false); editorPane25.setText("Sweets,Temples"); scrollPane26.setViewportView(editorPane25); } panel5.add(scrollPane26, CC.xy(11, 11)); } panel2.add(panel5, CC.xy(3, 1)); //======== panel4 ======== { panel4.setLayout(new FormLayout("default:grow", "2*(default, $lgap), default")); //---- label5 ---- label5.setIcon(new ImageIcon(getClass().getResource("/com/images/rajasthan/rajmap.jpg"))); panel4.add(label5, CC.xy(1, 1)); //---- label6 ---- label6.setIcon(new ImageIcon(getClass().getResource("/com/images/rajasthan/raj5.jpg"))); panel4.add(label6, CC.xy(1, 3)); //---- label7 ---- label7.setIcon(new ImageIcon(getClass().getResource("/com/images/rajasthan/raj7.jpg"))); panel4.add(label7, CC.xy(1, 5)); } panel2.add(panel4, CC.xy(5, 1)); } add(panel2, CC.xy(1, 2)); //======== panel6 ======== { panel6.setLayout(new FormLayout("default, $lcgap, default", "default")); //---- button1 ---- button1.setText("Go Back To Main Menu"); panel6.add(button1, CC.xy(1, 1)); } add(panel6, CC.xy(1, 4)); // JFormDesigner - End of component initialization //GEN-END:initComponents button1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { MainPageView.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 panel5; 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 scrollPane24; private JEditorPane editorPane23; 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 editorPane22; 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 scrollPane25; 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 scrollPane26; private JEditorPane editorPane25; private JPanel panel4; private JLabel label5; private JLabel label6; private JLabel label7; private JPanel panel6; private JButton button1; // JFormDesigner - End of variables declaration //GEN-END:variables }