Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Page 1 of 2 12 LastLast
Results 1 to 25 of 28

Thread: Evil JScrollBars

  1. #1
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Angry Evil JScrollBars

    I've tried with this code to get my ScrollBars to scroll down on the JFrame itself so I can enlarge the text area without losing any buttons. However, the only way to get the scrollbars to be of any nice size, still don't know if they will enlarge the JFrames ability to store more than can be viewable normally without scrollbars, but when that happens, my buttons take up the whole page, except for the scroll bar!!! Just one button takes up the whole page I mean. I've tried and tried and tried and I tried to do it on my own but it won't work and now I'm really upset.

    package Bible;
     
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
     
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
     
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
     
    import java.util.*;
    import java.io.*;
     
    import java.awt.event.WindowEvent;
    import java.awt.Window;
    import javax.swing.JScrollPane;
    import java.awt.Component;
    import javax.swing.JMenu;
    import javax.swing.JMenuItem;
    import javax.swing.JScrollBar;
     
    public class Bible {
    	public static void main(String[] args) {
    		BibleWindow frame = new BibleWindow();
    		frame.showGUI();
    	}
    }
     
    class BibleWindow extends JFrame {
    	JButton Genesis, Exodus, Leviticus, Numbers, Deuteronomy, Joshua, Judges, Ruth, ISamual, IISamual, IKings, IIKings, IChronicles, IIChronicles,
    	Ezra, Nehemiah, Esther, Job, Psalms, Proverbs, Ecclesiastes, SongOfSolomon, Isaiah, Jeremiah, Lamentations, Ezekiel, Daniel, Hosea, Joel, Amos, 
    	Obadiah, Jonah, Micah, Nahum, Habakkuk, Zephaniah, Haggai, Zechariah, Malachi, Matthew, Mark, Luke, John, Acts, Romans, ICorinthians, IICorinthians,
    	Galatians, Ephesians, Philippians, Colossians, IThessalonians, IIThessalonians, ITimothy, IITimothy, Titus, Philemon, Hebrews, James, IPeter, IIPeter,
    	IJohn, IIJohn, IIIJohn, Jude, Revelation;
    	JPanel panel;
    	JFrame bible;
    	GenWindow genWindow = new GenWindow();
    	ExoWindow exoWindow = new ExoWindow();
    	//	LevWindow levWindow = new LevWindow();
     
    	public BibleWindow() {
    		panel = new JPanel();
    		setTitle("Bible");
    		Genesis = new JButton("Genesis");
    		Exodus = new JButton("Exodus");
    		Leviticus = new JButton("Leviticus");
    		Numbers = new JButton("Numbers");
    		Deuteronomy = new JButton("Deuteronomy");
    		Joshua = new JButton("Joshua");
    		Judges = new JButton("Judges");
    		Ruth = new JButton("Ruth");
    		ISamual = new JButton("First Samual");
    		IISamual = new JButton("Second Samual");
    		IKings = new JButton("First Kings");
    		IIKings = new JButton("Second Kings");
    		IChronicles = new JButton("First Chronicles");
    		IIChronicles = new JButton("Second Chronicles");
    		Ezra = new JButton("Ezra");
    		Nehemiah = new JButton("Nehemiah");
    		Esther = new JButton("Esther");
    		Job = new JButton("Job");
    		Psalms = new JButton("Psalms");
    		Proverbs = new JButton("Proverbs");
    		Ecclesiastes = new JButton("Ecclesiastes");
    		SongOfSolomon = new JButton("Song of Solomon");
    		Isaiah = new JButton("Isaiah");
    		Jeremiah = new JButton("Jeremiah");
    		Lamentations = new JButton("Lamentations");
    		Ezekiel = new JButton("Ezekiel");
    		Daniel = new JButton("Daniel");
    		Hosea = new JButton("Hosea");
    		Joel = new JButton("Joel");
    		Amos = new JButton("Amos");
    		Obadiah = new JButton("Obadiah");
    		Jonah = new JButton("Jonah");
    		Micah = new JButton("Micah");
    		Nahum = new JButton("Nahum");
    		Habakkuk = new JButton("Habakkuk");
    		Zephaniah = new JButton("Zephaniah");
    		Haggai = new JButton("Haggai");
    		Zechariah = new JButton("Zechariah");
    		Malachi = new JButton("Malachi");
    		Matthew = new JButton("Matthew");
    		Mark = new JButton("Mark");
    		Luke = new JButton("Luke");
    		John = new JButton("John");
    		Acts = new JButton("Acts");
    		Romans = new JButton("Romans");
    		ICorinthians = new JButton("First Corinthians");
    		IICorinthians = new JButton("Second Corinthians");
    		Galatians = new JButton("Galatians");
    		Ephesians = new JButton("Ephesians");
    		Philippians = new JButton("Philippians");
    		Colossians = new JButton("Colossians");
    		IThessalonians = new JButton("First Thessalonians");
    		IIThessalonians = new JButton("Second Thessalonians");
    		ITimothy = new JButton("First Timothy");
    		IITimothy = new JButton("Second Timothy");
    		Titus = new JButton("Titus");
    		Philemon = new JButton("Philemon");
    		Hebrews = new JButton("Hebrews");
    		James = new JButton("James");
    		IPeter = new JButton("First Peter");
    		IIPeter = new JButton("Second Peter");
    		IJohn = new JButton("First John");
    		IIJohn = new JButton("Second John");
    		IIIJohn = new JButton("Third John");
    		Jude = new JButton("Jude");
    		Revelation = new JButton("Revelation");
     
    		String string = " © 2010 Jedi Penguin's Bibles R Us.  All Rights Reserved." + "\n" + 
    		"This program is meant to be read.  Altering the code to add or remove from " +
    		"the Bible is not encouraged by the designer." + "\n" + "If the user does so, " +
    		"he/she is doing so at his/her own risk and the designer is not responsible for any" +
    		" plagues sent his/her way for altering said code.";
     
     
    		Object[] Copyright =  {"I agree" , "I do not agree"};
    		int a = JOptionPane.showOptionDialog(bible,
    				string,
    				"Welcome to Bible Program",
    				JOptionPane.YES_NO_OPTION,
    				JOptionPane.WARNING_MESSAGE,
    				null,       Copyright,     Copyright[0]); 
    		if (a == JOptionPane.YES_OPTION) 
    		{ // beginning of if
    			// continues;
    		} // end of if								
    		else if (a == JOptionPane.NO_OPTION)
    		{ // beginning of else if
    			System.exit(0);
    		} // end of else if
     
     
     
    		Genesis.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
    						genWindow.setVisible(true);
    					}
    				});
     
    		Exodus.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
    						exoWindow.setVisible(true);
     
    					}
    				});
     
     
    		panel.add(Genesis);
    		panel.add(Exodus);
    		panel.add(Leviticus);
    		panel.add(Numbers);
    		panel.add(Deuteronomy);
    		panel.add(Joshua);
    		panel.add(Judges);
    		panel.add(Ruth);
    		panel.add(ISamual);
    		panel.add(IISamual);
    		panel.add(IKings);
    		panel.add(IIKings);
    		panel.add(IChronicles);
    		panel.add(IIChronicles);
    		panel.add(Ezra);
    		panel.add(Nehemiah);
    		panel.add(Esther);
    		panel.add(Job);
    		panel.add(Psalms);
    		panel.add(Proverbs);
    		panel.add(Ecclesiastes);
    		panel.add(SongOfSolomon);
    		panel.add(Isaiah);
    		panel.add(Jeremiah);
    		panel.add(Lamentations);
    		panel.add(Ezekiel);
    		panel.add(Daniel);
    		panel.add(Hosea);
    		panel.add(Joel);
    		panel.add(Amos);
    		panel.add(Obadiah);
    		panel.add(Jonah);
    		panel.add(Micah);
    		panel.add(Nahum);
    		panel.add(Habakkuk);
    		panel.add(Zephaniah);
    		panel.add(Haggai);
    		panel.add(Zechariah);
    		panel.add(Malachi);
    		panel.add(Matthew);
    		panel.add(Mark);
    		panel.add(Luke);
    		panel.add(John);
    		panel.add(Acts);
    		panel.add(Romans);
    		panel.add(ICorinthians);
    		panel.add(IICorinthians);
    		panel.add(Galatians);
    		panel.add(Ephesians);
    		panel.add(Philippians);
    		panel.add(Colossians);
    		panel.add(IThessalonians);
    		panel.add(IIThessalonians);
    		panel.add(ITimothy);
    		panel.add(IITimothy);
    		panel.add(Titus);
    		panel.add(Philemon);
    		panel.add(Hebrews);
    		panel.add(James);
    		panel.add(IPeter);
    		panel.add(IIPeter);
    		panel.add(IJohn);
    		panel.add(IIJohn);
    		panel.add(IIIJohn);
    		panel.add(Jude);
    		panel.add(Revelation);
     
     
    		getContentPane().add(panel);
    	}
     
    	public void showGUI() {
    		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		setSize(300,300);
    		setLocation(100,100);
    		setVisible(true);
    	} 
    }
     
    class GenWindow extends JFrame {
    	JButton chap1, chap2, chap3, chap4, chap5, chap6, chap7, chap8, chap9, chap10, chap11, chap12, chap13, chap14, chap15, chap16, chap17, chap18,
    	chap19, chap20, chap21, chap22, chap23, chap24, chap25, chap26, chap27, chap28, chap29, chap30, chap31, chap32, chap33, chap34, chap35,
    	chap36, chap37, chap38, chap39, chap40, chap41, chap42, chap43, chap44, chap45, chap46, chap47, chap48, chap49, chap50, lastChapter, nextChapter, copy;
    	JFrame frameG;
     
     
    	JScrollPane scroll, scroll2;
     
    	JTextArea textArea, textArea2;
     
    	JMenu menu;
     
    	JMenuItem item;
     
     
    	JPanel panel2;
    	JPanel special;
    	public GenWindow() {
    		setTitle("Genesis");
    		panel2 = new JPanel();
    		special = new JPanel();
     
    		chap1 = new JButton("Chapter One");
    		chap2 = new JButton("Chapter Two");
    		chap3 = new JButton("Chapter Three");
    		chap4 = new JButton("Chapter Four");
    		chap5 = new JButton("Chapter Five");
    		chap6 = new JButton("Chapter Six");
    		chap7 = new JButton("Chapter Seven");
    		chap8 = new JButton("Chapter Eight");
    		chap9 = new JButton("Chapter Nine");
    		chap10 = new JButton("Chapter Ten");
    		chap11 = new JButton("Chapter Eleven");
    		chap12 = new JButton("Chapter Twelve");
    		chap13 = new JButton ("Chapter Thirteen");
    		chap14 = new JButton("Chapter Fourteen");
    		chap15 = new JButton("Chapter Fifteen");
    		chap16 = new JButton("Chapter Sixteen");
    		chap17 = new JButton ("Chapter Seventeen");
    		chap18 = new JButton ("Chapter Eighteen");
    		chap19 = new JButton ("Chapter Nineteen");
    		chap20 = new JButton("Chapter Twenty");
    		chap21 = new JButton("Chapter Twenty-one");
    		chap22 = new JButton("Chapter Twenty-two");
    		chap23 = new JButton("Chapter Twenty-three");
    		chap24 = new JButton("Chapter Twenty-four");
    		chap25 = new JButton("Chapter Twenty-five");
    		chap26 = new JButton("Chapter Twenty-six");
    		chap27 = new JButton("Chapter Twenty-seven");
    		chap28 = new JButton("Chapter Twenty-eight");
    		chap29 = new JButton("Chapter Twenty-nine");
    		chap30 = new JButton("Chapter Thirty");
    		chap31 = new JButton("Chapter Thirty-one");
    		chap32 = new JButton("Chapter Thirty-two");
    		chap33 = new JButton("Chapter Thirty-three");
    		chap34 = new JButton("Chapter Thirty-four");
    		chap35 = new JButton("Chapter Thirty-five");
    		chap36 = new JButton("Chapter Thirty-six");
    		chap37 = new JButton("Chapter Thirty-seven");
    		chap38 = new JButton("Chapter Thirty-eight");
    		chap39 = new JButton("Chapter Thirty-nine");
    		chap40 = new JButton("Chapter Forty");
    		chap41 = new JButton("Chapter Forty-one");
    		chap42 = new JButton("Chapter Forty-two");
    		chap43 = new JButton("Chapter Forty-three");
    		chap44 = new JButton("Chapter Forty-four");
    		chap45 = new JButton("Chapter Forty-five");
    		chap46 = new JButton("Chapter Forty-six");
    		chap47 = new JButton("Chapter Forty-seven");
    		chap48 = new JButton("Chapter Forty-eight");
    		chap49 = new JButton("Chapter Forty-nine");
    		chap50 = new JButton("Chapter Fifty");
    		lastChapter = new JButton("Previous Chapter");
    		nextChapter = new JButton("Next Chapter");
    		copy = new JButton("Copy");
     
     
     
     
    		textArea = new JTextArea  (25, 25);
    		int x = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
    		int y = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
    		textArea.setEditable(false);
    		scroll = new JScrollPane(textArea, x, y);
    		scroll.setVisible(true);
    		panel2.add(scroll);
     
    		copy.addActionListener(
    				new ActionListener()
    				{
    					public void actionPerformed(ActionEvent e)
    					{
    						textArea.copy();
    					}
    				}
    		);
     
     
    		chap1.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
    						String genChap1 = "Genesis Chapter One" + "\n" +
    						"1     ¶ In the beginning God created the heaven and the earth. " + "\n" +
    						"2     And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters." + "\n" +
    						"3     ¶ And God said, Let there be light: and there was light." + "\n" +
    						"4     And God saw the light, that it was good: and God divided the light from the darkness." + "\n" +
    						"5     And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day." + "\n" +
    						"6     ¶ And God said, Let there be a firmament in the midst of the waters, and let it divide the waters from the waters. " + "\n" +
    						"7     And God made the firmament, and divided the waters which were under the firmament from the waters which were above the firmament: and it was so." + "\n" +
    						"8     And God called the firmament Heaven. And the evening and the morning were the second day." + "\n" +
    						"9     ¶ And God said, Let the waters under the heaven be gathered together unto one place, and let the dry land appear: and it was so." + "\n" +
    						"10     And God called the dry land Earth; and the gathering together of the waters called he Seas: and God saw that it was good." + "\n" +
    						"11     And God said, Let the earth bring forth grass, the herb yielding seed, and the fruit tree yielding fruit after his kind, whose seed is in itself, upon the earth: and it was so." + "\n" +
    						"12     And the earth brought forth grass, and herb yielding seed after his kind, and the tree yielding fruit, whose seed was in itself, after his kind: and God saw that it was good." + "\n" +
    						"13     And the evening and the morning were the third day." + "\n" +
    						"14     ¶ And God said, Let there be lights in the firmament of the heaven to divide the day from the night; and let them be for signs, and for seasons, and for days, and years:" + "\n" +
    						"15     And let them be for lights in the firmament of the heaven to give light upon the earth: and it was so." + "\n" +
    						"16     And God made two great lights; the greater light to rule the day, and the lesser light to rule the night: he made the stars also." + "\n" +
    						"17     And God set them in the firmament of the heaven to give light upon the earth," + "\n" +
    						"18     And to rule over the day and over the night, and to divide the light from the darkness: and God saw that it was good." + "\n" +
    						"19     And the evening and the morning were the fourth day." + "\n" +
    						"20     ¶ And God said, Let the waters bring forth abundantly the moving creature that hath life, and fowl that may fly above the earth in the open firmament of heaven." + "\n" +
    						"21     And God created great whales, and every living creature that moveth, which the waters brought forth abundantly, after their kind, and every winged fowl after his kind: and God saw that it was good." + "\n" +
    						"22     And God blessed them, saying, Be fruitful, and multiply, and fill the waters in the seas, and let fowl multiply in the earth." + "\n" +
    						"23     And the evening and the morning were the fifth day." + "\n" +
    						"24     ¶ And God said, Let the earth bring forth the living creature after his kind, cattle, and creeping thing, and beast of the earth after his kind: and it was so." + "\n" +
    						"25     And God made the beast of the earth after his kind, and cattle after their kind, and every thing that creepeth upon the earth after his kind: and God saw that it was good." + "\n" +
    						"26     ¶ And God said, Let us make man in our image, after our likeness: and let them have dominion over the fish of the sea, and over the fowl of the air, and over the cattle, and over all the earth, and over every creeping thing that creepeth upon the earth." + "\n" +
    						"27     So God created man in his own image, in the image of God created he him; male and female created he them." + "\n" +
    						"28     And God blessed them, and God said unto them, Be fruitful, and multiply, and replenish the earth, and subdue it: and have dominion over the fish of the sea, and over the fowl of the air, and over every living thing that moveth upon the earth." + "\n" +
    						"29     ¶ And God said, Behold, I have given you every herb bearing seed, which is upon the face of all the earth, and every tree, in the which is the fruit of a tree yielding seed; to you it shall be for meat." + "\n" +
    						"30     And to every beast of the earth, and to every fowl of the air, and to every thing that creepeth upon the earth, wherein there is life, I have given every green herb for meat: and it was so." + "\n" +
    						"31     ¶ And God saw every thing that he had made, and, behold, it was very good. And the evening and the morning were the sixth day. " ;
     
    						//System.out.println(genChap1);     
    						textArea.setText(genChap1);             
     
     
    						// not practical but will keep this one in case I need future reference 
     
    						Object[] Genesis1 =  {"Search" , "Ok"};
    						int a = JOptionPane.showOptionDialog(frameG,
    								"Enter text to begin search.",
    								"This checks to see if the text you entered is in chapter",
    								JOptionPane.YES_NO_OPTION,
    								JOptionPane.QUESTION_MESSAGE,
    								null,        Genesis1,     Genesis1[0]); 
    						if (a == JOptionPane.YES_OPTION) 
    						{ // beginning of if
    							// clicks on Chapter Two button and opens chapter 2, I hope
    							String inputStr;
    							inputStr = JOptionPane.showInputDialog(null,"Search");
    							if (genChap1.contains(inputStr) == true)
    							{ // beginning of if
    								// System.out.println("'" + inputStr + "'" + " is in chapter");
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " is in chapter" , "Search item found", +  JOptionPane.INFORMATION_MESSAGE);
    							}  // end of if
    							else 
    							{ // beginning of else
    								//   System.out.println("'" + inputStr + "'" + " isn't in chapter");
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " isn't in chapter" , "Search item not found", +  JOptionPane.ERROR_MESSAGE);
     
    							} // end of else
     
    						} // end of if
     
    						else if (a == JOptionPane.NO_OPTION)
    						{ // beginning of else if
     
    							// does nothing
    						} // end of else if
     
     
    					}
    				});
     
    		chap2.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
    						String genChap2 = "Genesis Chapter Two" + "\n" + 
    						"1     ¶ Thus the heavens and the earth were finished, and all the host of them." + "\n" + 
    						"2     And on the seventh day God ended his work which he had made; and he rested on the seventh day from all his work which he had made." + "\n" +
    						"3     And God blessed the seventh day, and sanctified it: because that in it he had rested from all his work which God created and made." + "\n" +
    						"4     ¶ These are the generations of the heavens and of the earth when they were created, in the day that the LORD God made the earth and the heavens," + "\n" +
    						"5     And every plant of the field before it was in the earth, and every herb of the field before it grew: for the LORD God had not caused it to rain upon the earth, and there was not a man to till the ground." + "\n" +
    						"6     But there went up a mist from the earth, and watered the whole face of the ground." + "\n" +
    						"7     And the LORD God formed man of the dust of the ground, and breathed into his nostrils the breath of life; and man became a living soul." + "\n" +
    						"8     ¶ And the LORD God planted a garden eastward in Eden; and there he put the man whom he had formed." + "\n" +
    						"9     And out of the ground made the LORD God to grow every tree that is pleasant to the sight, and good for food; the tree of life also in the midst of the garden, and the tree of knowledge of good and evil." + "\n" +
    						"10     And a river went out of Eden to water the garden; and from thence it was parted, and became into four heads." + "\n" +
    						"11     The name of the first is Pison: that is it which compasseth the whole land of Havilah, where there is gold;" + "\n" +
    						"12     And the gold of that land is good: there is bdellium and the onyx stone." + "\n" +
    						"13     And the name of the second river is Gihon: the same is it that compasseth the whole land of Ethiopia." + "\n" +
    						"14     And the name of the third river is Hiddekel: that is it which goeth toward the east of Assyria. And the fourth river is Euphrates." + "\n" +
    						"15     And the LORD God took the man, and put him into the garden of Eden to dress it and to keep it." + "\n" +
    						"16     ¶ And the LORD God commanded the man, saying, Of every tree of the garden thou mayest freely eat:" + "\n" +
    						"17     But of the tree of the knowledge of good and evil, thou shalt not eat of it: for in the day that thou eatest thereof thou shalt surely die." + "\n" +
    						"18     ¶ And the LORD God said, It is not good that the man should be alone; I will make him an help meet for him." + "\n" +
    						"19     And out of the ground the LORD God formed every beast of the field, and every fowl of the air; and brought them unto Adam to see what he would call them: and whatsoever Adam called every living creature, that was the name thereof." + "\n" +
    						"20     And Adam gave names to all cattle, and to the fowl of the air, and to every beast of the field; but for Adam there was not found an help meet for him." + "\n" +
    						"21     ¶ And the LORD God caused a deep sleep to fall upon Adam, and he slept: and he took one of his ribs, and closed up the flesh instead thereof;" + "\n" +
    						"22     And the rib, which the LORD God had taken from man, made he a woman, and brought her unto the man." + "\n" +
    						"23     And Adam said, This is now bone of my bones, and flesh of my flesh: she shall be called Woman, because she was taken out of Man." + "\n" +
    						"24     Therefore shall a man leave his father and his mother, and shall cleave unto his wife: and they shall be one flesh." + "\n" +
    						"25     And they were both naked, the man and his wife, and were not ashamed. ";
    						// System.out.println(genChap2);
    						textArea.setText(genChap2);
    						Object[] Genesis2=  {"Search" , "Ok"};
    						int a = JOptionPane.showOptionDialog(frameG,
    								"Enter text to begin search.",
    								"This checks to see if the text you entered is in chapter",
    								JOptionPane.YES_NO_OPTION,
    								JOptionPane.QUESTION_MESSAGE,
    								null,        Genesis2,     Genesis2[0]); 
    						if (a == JOptionPane.YES_OPTION) 
    						{ // beginning of if
    							// clicks on Chapter Two button and opens chapter 2, I hope
    							String inputStr;
    							inputStr = JOptionPane.showInputDialog(null,"Search");
    							if (genChap2.contains(inputStr) == true)
    							{ // beginning of if
    								//     System.out.println("'" + inputStr + "'" + " is in chapter");
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " is in chapter" , "Search item found", +  JOptionPane.INFORMATION_MESSAGE);
    							}  // end of if
    							else 
    							{ // beginning of else
    								// System.out.println("'" + inputStr + "'" + " isn't in chapter");
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " isn't in chapter" , "Search item not found", +  JOptionPane.ERROR_MESSAGE);
     
    							} // end of else
     
    						} // end of if
     
    						else if (a == JOptionPane.NO_OPTION)
    						{ // beginning of else if
     
    							// does nothing
    						} // end of else if
     
     
    					}
    				});
     
    		chap3.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
    						String genChap3 = "Genesis Chapter Three" + "\n" +
    						"1     ¶ Now the serpent was more subtil than any beast of the field which the LORD God had made. And he said unto the woman, Yea, hath God said, Ye shall not eat of every tree of the garden?"  + "\n" +
    						"2     And the woman said unto the serpent, We may eat of the fruit of the trees of the garden:"  + "\n" +
    						"3     But of the fruit of the tree which is in the midst of the garden, God hath said, Ye shall not eat of it, neither shall ye touch it, lest ye die." + "\n" +
    						"4     And the serpent said unto the woman, Ye shall not surely die:" + "\n" +
    						"5     For God doth know that in the day ye eat thereof, then your eyes shall be opened, and ye shall be as gods, knowing good and evil." + "\n" +
    						"6     ¶ And when the woman saw that the tree was good for food, and that it was pleasant to the eyes, and a tree to be desired to make one wise, she took of the fruit thereof, and did eat, and gave also unto her husband with her; and he did eat." + "\n" +
    						"7     And the eyes of them both were opened, and they knew that they were naked; and they sewed fig leaves together, and made themselves aprons." + "\n" +
    						"8     And they heard the voice of the LORD God walking in the garden in the cool of the day: and Adam and his wife hid themselves from the presence of the LORD God amongst the trees of the garden." + "\n" +
    						"9     ¶ And the LORD God called unto Adam, and said unto him, Where art thou?" + "\n" +
    						"10     And he said, I heard thy voice in the garden, and I was afraid, because I was naked; and I hid myself." + "\n" +
    						"11     ¶ And he said, Who told thee that thou wast naked? Hast thou eaten of the tree, whereof I commanded thee that thou shouldest not eat?" + "\n" +
    						"12     And the man said, The woman whom thou gavest to be with me, she gave me of the tree, and I did eat." + "\n" +
    						"13     And the LORD God said unto the woman, What is this that thou hast done? And the woman said, The serpent beguiled me, and I did eat." + "\n" +
    						"14     ¶ And the LORD God said unto the serpent, Because thou hast done this, thou art cursed above all cattle, and above every beast of the field; upon thy belly shalt thou go, and dust shalt thou eat all the days of thy life:" + "\n" +
    						"15     And I will put enmity between thee and the woman, and between thy seed and her seed; it shall bruise thy head, and thou shalt bruise his heel." + "\n" +
    						"16     ¶ Unto the woman he said, I will greatly multiply thy sorrow and thy conception; in sorrow thou shalt bring forth children; and thy desire shall be to thy husband, and he shall rule over thee."+ "\n" +
    						"17     ¶ And unto Adam he said, Because thou hast hearkened unto the voice of thy wife, and hast eaten of the tree, of which I commanded thee, saying, Thou shalt not eat of it: cursed is the ground for thy sake; in sorrow shalt thou eat of it all the days of thy life;" + "\n" +
    						"18     Thorns also and thistles shall it bring forth to thee; and thou shalt eat the herb of the field;" + "\n" +
    						"19     In the sweat of thy face shalt thou eat bread, till thou return unto the ground; for out of it wast thou taken: for dust thou art, and unto dust shalt thou return." + "\n" +
    						"20     ¶ And Adam called his wife's name Eve; because she was the mother of all living." + "\n" +
    						"21     ¶ Unto Adam also and to his wife did the LORD God make coats of skins, and clothed them." + "\n" +
    						"22     ¶ And the LORD God said, Behold, the man is become as one of us, to know good and evil: and now, lest he put forth his hand, and take also of the tree of life, and eat, and live for ever:" + "\n" +
    						"23     Therefore the LORD God sent him forth from the garden of Eden, to till the ground from whence he was taken." + "\n" +
    						"24     So he drove out the man; and he placed at the east of the garden of Eden Cherubims, and a flaming sword which turned every way, to keep the way of the tree of life.";
     
    						//  System.out.println(genChap3);
    						textArea.setText(genChap3);
     
    						Object[] Genesis3=  {"Search" , "Ok"};
    						int a = JOptionPane.showOptionDialog(frameG,
    								"Enter text to begin search.",
    								"This checks to see if the text you entered is in chapter",
    								JOptionPane.YES_NO_OPTION,
    								JOptionPane.QUESTION_MESSAGE,
    								null,        Genesis3,     Genesis3[0]); 
    						if (a == JOptionPane.YES_OPTION) 
    						{ // beginning of if
    							// clicks on Chapter Two button and opens chapter 2, I hope
    							String inputStr;
    							inputStr = JOptionPane.showInputDialog(null,"Search");
    							if (genChap3.contains(inputStr) == true)
    							{ // beginning of if
    								//    System.out.println("'" + inputStr + "'" + " is in chapter");
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " is in chapter" , "Search item found", +  JOptionPane.INFORMATION_MESSAGE);
    							}  // end of if
    							else 
    							{ // beginning of else
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " isn't in chapter" , "Search item not found", +  JOptionPane.ERROR_MESSAGE);
     
    							} // end of else
     
    						} // end of if
     
    						else if (a == JOptionPane.NO_OPTION)
    						{ // beginning of else if
     
    							// does nothing
    						} // end of else if
     
     
    					}
    				});
     
    		chap4.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
     
    						String genChap4 =	"Genesis Chapter Four" + "\n" +
    						"1     ¶ And Adam knew Eve his wife; and she conceived, and bare Cain, and said, I have gotten a man from the LORD." + "\n" +
    						"2     And she again bare his brother Abel. And Abel was a keeper of sheep, but Cain was a tiller of the ground." + "\n" +
    						"3     ¶ And in process of time it came to pass, that Cain brought of the fruit of the ground an offering unto the LORD." + "\n" +
    						"4     And Abel, he also brought of the firstlings of his flock and of the fat thereof. And the LORD had respect unto Abel and to his offering:" + "\n" +
    						"5     But unto Cain and to his offering he had not respect. And Cain was very wroth, and his countenance fell." + "\n" +
    						"6     ¶ And the LORD said unto Cain, Why art thou wroth? and why is thy countenance fallen?" + "\n" +
    						"7     If thou doest well, shalt thou not be accepted? and if thou doest not well, sin lieth at the door. And unto thee shall be his desire, and thou shalt rule over him." + "\n" +
    						"8     ¶ And Cain talked with Abel his brother: and it came to pass, when they were in the field, that Cain rose up against Abel his brother, and slew him." + "\n" +
    						"9     ¶ And the LORD said unto Cain, Where is Abel thy brother? And he said, I know not: Am I my brother's keeper?" + "\n" +
    						"10     And he said, What hast thou done? the voice of thy brother's blood crieth unto me from the ground." + "\n" +
    						"11     And now art thou cursed from the earth, which hath opened her mouth to receive thy brother's blood from thy hand;" + "\n" +
    						"12     When thou tillest the ground, it shall not henceforth yield unto thee her strength; a fugitive and a vagabond shalt thou be in the earth." + "\n" +
    						"13     ¶ And Cain said unto the LORD, My punishment is greater than I can bear." + "\n" +
    						"14     Behold, thou hast driven me out this day from the face of the earth; and from thy face shall I be hid; and I shall be a fugitive and a vagabond in the earth; and it shall come to pass, that every one that findeth me shall slay me." + "\n" +
    						"15     And the LORD said unto him, Therefore whosoever slayeth Cain, vengeance shall be taken on him sevenfold. And the LORD set a mark upon Cain, lest any finding him should kill him." + "\n" +
    						"16     ¶ And Cain went out from the presence of the LORD, and dwelt in the land of Nod, on the east of Eden." + "\n" +
    						"17     And Cain knew his wife; and she conceived, and bare Enoch: and he builded a city, and called the name of the city, after the name of his son, Enoch." + "\n" +
    						"18     And unto Enoch was born Irad: and Irad begat Mehujael: and Mehujael begat Methusael: and Methusael begat Lamech." + "\n" +
    						"19     ¶ And Lamech took unto him two wives: the name of the one was Adah, and the name of the other Zillah." + "\n" +
    						"20     And Adah bare Jabal: he was the father of such as dwell in tents, and of such as have cattle." + "\n" +
    						"21     And his brother's name was Jubal: he was the father of all such as handle the harp and organ." + "\n" +
    						"22     And Zillah, she also bare Tubalcain, an instructer of every artificer in brass and iron: and the sister of Tubalcain was Naamah." + "\n" +
    						"23     ¶ And Lamech said unto his wives, Adah and Zillah, Hear my voice; ye wives of Lamech, hearken unto my speech: for I have slain a man to my wounding, and a young man to my hurt." + "\n" +
    						"24     If Cain shall be avenged sevenfold, truly Lamech seventy and sevenfold." + "\n" +
    						"25     ¶ And Adam knew his wife again; and she bare a son, and called his name Seth: For God, said she, hath appointed me another seed instead of Abel, whom Cain slew." + "\n" +
    						"26     And to Seth, to him also there was born a son; and he called his name Enos: then began men to call upon the name of the LORD. ";
    						//  System.out.println(genChap4);
    						textArea.setText(genChap4);
    						Object[] Genesis4=  {"Search" , "Ok"};
    						int a = JOptionPane.showOptionDialog(frameG,
    								"Enter text to begin search.",
    								"This checks to see if the text you entered is in chapter",
    								JOptionPane.YES_NO_OPTION,
    								JOptionPane.QUESTION_MESSAGE,
    								null,        Genesis4,     Genesis4[0]); 
    						if (a == JOptionPane.YES_OPTION) 
    						{ // beginning of if
    							// clicks on Chapter Two button and opens chapter 2, I hope
    							String inputStr;
    							inputStr = JOptionPane.showInputDialog(null,"Search");
    							if (genChap4.contains(inputStr) == true)
    							{ // beginning of if
    								//    System.out.println("'" + inputStr + "'" + " is in chapter");
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " is in chapter" , "Search item found", +  JOptionPane.INFORMATION_MESSAGE);
    							}  // end of if
    							else 
    							{ // beginning of else
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " isn't in chapter" , "Search item not found", +  JOptionPane.ERROR_MESSAGE);
     
    							} // end of else
     
    						} // end of if
     
    						else if (a == JOptionPane.NO_OPTION)
    						{ // beginning of else if
     
    							// does nothing
    						} // end of else if
     
    					}
    				});
     
    		chap5.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
    						String genChap5 = "Genesis Chapter 5" + "\n" +
    						"1     ¶ This is the book of the generations of Adam. In the day that God created man, in the likeness of God made he him;" + "\n" +
    						"2     Male and female created he them; and blessed them, and called their name Adam, in the day when they were created." + "\n" +
    						"3     And Adam lived an hundred and thirty years, and begat a son in his own likeness, after his image; and called his name Seth:" + "\n" +
    						"4     And the days of Adam after he had begotten Seth were eight hundred years: and he begat sons and daughters:" + "\n" +
    						"5     And all the days that Adam lived were nine hundred and thirty years: and he died." + "\n" +
    						"6     ¶ And Seth lived an hundred and five years, and begat Enos:" + "\n" +
    						"7     And Seth lived after he begat Enos eight hundred and seven years, and begat sons and daughters:"+ "\n" +
    						"8     And all the days of Seth were nine hundred and twelve years: and he died." + "\n" +
    						"9     And Enos lived ninety years, and begat Cainan:" + "\n" +
    						"10     And Enos lived after he begat Cainan eight hundred and fifteen years, and begat sons and daughters:" + "\n" +
    						"11     And all the days of Enos were nine hundred and five years: and he died." + "\n" +
    						"12     And Cainan lived seventy years, and begat Mahalaleel:" + "\n" +
    						"13     And Cainan lived after he begat Mahalaleel eight hundred and forty years, and begat sons and daughters:" + "\n" +
    						"14     And all the days of Cainan were nine hundred and ten years: and he died." + "\n" +
    						"15     And Mahalaleel lived sixty and five years, and begat Jared:" + "\n" +
    						"16     And Mahalaleel lived after he begat Jared eight hundred and thirty years, and begat sons and daughters:" + "\n" +
    						"17     And all the days of Mahalaleel were eight hundred ninety and five years: and he died." + "\n" +
    						"18     And Jared lived an hundred sixty and two years, and he begat Enoch:" + "\n" +
    						"19     And Jared lived after he begat Enoch eight hundred years, and begat sons and daughters:" + "\n" +
    						"20     And all the days of Jared were nine hundred sixty and two years: and he died." + "\n" +
    						"21     ¶ And Enoch lived sixty and five years, and begat Methuselah:" + "\n" +
    						"22     And Enoch walked with God after he begat Methuselah three hundred years, and begat sons and daughters:" + "\n" +
    						"23     And all the days of Enoch were three hundred sixty and five years:" + "\n" +
    						"24     And Enoch walked with God: and he was not; for God took him." + "\n" +
    						"25     ¶ And Methuselah lived an hundred eighty and seven years, and begat Lamech:" + "\n" +
    						"26     And Methuselah lived after he begat Lamech seven hundred eighty and two years, and begat sons and daughters:" + "\n" +
    						"27     And all the days of Methuselah were nine hundred sixty and nine years: and he died." + "\n" +
    						"28     ¶ And Lamech lived an hundred eighty and two years, and begat a son:" + "\n" +
    						"29     And he called his name Noah, saying, This same shall comfort us concerning our work and toil of our hands, because of the ground which the LORD hath cursed." + "\n" +
    						"30     And Lamech lived after he begat Noah five hundred ninety and five years, and begat sons and daughters:" + "\n" +
    						"31     And all the days of Lamech were seven hundred seventy and seven years: and he died." + "\n" +
    						"32     And Noah was five hundred years old: and Noah begat Shem, Ham, and Japheth. ";
    						textArea.setText(genChap5);
     
    						Object[] Genesis5=  {"Search" , "Ok"};
    						int a = JOptionPane.showOptionDialog(frameG,
    								"Enter text to begin search.",
    								"This checks to see if the text you entered is in chapter",
    								JOptionPane.YES_NO_OPTION,
    								JOptionPane.QUESTION_MESSAGE,
    								null,        Genesis5,     Genesis5[0]); 
    						if (a == JOptionPane.YES_OPTION) 
    						{ // beginning of if
    							// clicks on Chapter Two button and opens chapter 2, I hope
    							String inputStr;
    							inputStr = JOptionPane.showInputDialog(null,"Search");
    							if (genChap5.contains(inputStr) == true)
    							{ // beginning of if
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " is in chapter" , "Search item found", +  JOptionPane.INFORMATION_MESSAGE);
    							}  // end of if
    							else 
    							{ // beginning of else
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " isn't in chapter" , "Search item not found", +  JOptionPane.ERROR_MESSAGE);
     
    							} // end of else
     
    						} // end of if
     
    						else if (a == JOptionPane.NO_OPTION)
    						{ // beginning of else if
     
    							// does nothing
    						} // end of else if
     
    					}
    				});
     
    		chap6.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
    						String genChap6 = "Genesis Chapter Six" + "\n" + 
    						"1     ¶ And it came to pass, when men began to multiply on the face of the earth, and daughters were born unto them," + "\n" + 
    						"2     That the sons of God saw the daughters of men that they were fair; and they took them wives of all which they chose." + "\n" + 
    						"3     ¶ And the LORD said, My spirit shall not always strive with man, for that he also is flesh: yet his days shall be an hundred and twenty years." + "\n" + 
    						"4     ¶ There were giants in the earth in those days; and also after that, when the sons of God came in unto the daughters of men, and they bare children to them, the same became mighty men which were of old, men of renown." + "\n" + 
    						"5     And GOD saw that the wickedness of man was great in the earth, and that every imagination of the thoughts of his heart was only evil continually." + "\n" + 
    						"6     ¶ And it repented the LORD that he had made man on the earth, and it grieved him at his heart." + "\n" + 
    						"7     And the LORD said, I will destroy man whom I have created from the face of the earth; both man, and beast, and the creeping thing, and the fowls of the air; for it repenteth me that I have made them." + "\n" + 
    						"8     ¶ But Noah found grace in the eyes of the LORD." + "\n" + 
    						"9     These are the generations of Noah: Noah was a just man and perfect in his generations, and Noah walked with God." + "\n" + 
    						"10     And Noah begat three sons, Shem, Ham, and Japheth." + "\n" + 
    						"11     ¶ The earth also was corrupt before God, and the earth was filled with violence." + "\n" + 
    						"12     And God looked upon the earth, and, behold, it was corrupt; for all flesh had corrupted his way upon the earth." + "\n" + 
    						"13     ¶ And God said unto Noah, The end of all flesh is come before me; for the earth is filled with violence through them; and, behold, I will destroy them with the earth." + "\n" + 
    						"14     Make thee an ark of gopher wood; rooms shalt thou make in the ark, and shalt pitch it within and without with pitch." + "\n" + 
    						"15     And this is the fashion which thou shalt make it of: The length of the ark shall be three hundred cubits, the breadth of it fifty cubits, and the height of it thirty cubits." + "\n" + 
    						"16     A window shalt thou make to the ark, and in a cubit shalt thou finish it above; and the door of the ark shalt thou set in the side thereof; with lower, second, and third stories shalt thou make it." + "\n" + 
    						"17     And, behold, I, even I, do bring a flood of waters upon the earth, to destroy all flesh, wherein is the breath of life, from under heaven; and every thing that is in the earth shall die." + "\n" + 
    						"18     But with thee will I establish my covenant; and thou shalt come into the ark, thou, and thy sons, and thy wife, and thy sons' wives with thee." + "\n" + 
    						"19     And of every living thing of all flesh, two of every sort shalt thou bring into the ark, to keep them alive with thee; they shall be male and female." + "\n" + 
    						"20     Of fowls after their kind, and of cattle after their kind, of every creeping thing of the earth after his kind, two of every sort shall come unto thee, to keep them alive." + "\n" + 
    						"21     And take thou unto thee of all food that is eaten, and thou shalt gather it to thee; and it shall be for food for thee, and for them." + "\n" + 
    						"22     ¶ Thus did Noah; according to all that God commanded him, so did he. ";
     
    						textArea.setText(genChap6);
     
    						Object[] Genesis6=  {"Search" , "Ok"};
    						int a = JOptionPane.showOptionDialog(frameG,
    								"Enter text to begin search.",
    								"This checks to see if the text you entered is in chapter",
    								JOptionPane.YES_NO_OPTION,
    								JOptionPane.QUESTION_MESSAGE,
    								null,        Genesis6,     Genesis6[0]); 
    						if (a == JOptionPane.YES_OPTION) 
    						{ // beginning of if
    							// clicks on Chapter Two button and opens chapter 2, I hope
    							String inputStr;
    							inputStr = JOptionPane.showInputDialog(null,"Search");
    							if (genChap6.contains(inputStr) == true)
    							{ // beginning of if
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " is in chapter" , "Search item found", +  JOptionPane.INFORMATION_MESSAGE);
    							}  // end of if
    							else 
    							{ // beginning of else
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " isn't in chapter" , "Search item not found", +  JOptionPane.ERROR_MESSAGE);
     
    							} // end of else
     
    						} // end of if
     
    						else if (a == JOptionPane.NO_OPTION)
    						{ // beginning of else if
     
    							// does nothing
    						} // end of else if
    					}
    				});
     
    		chap7.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
    						String genChap7 = "Genesis Chapter Seven" + "\n" + 
    						" 1 And the LORD said unto Noah, Come thou and all thy house into the ark; for thee have I seen righteous before me in this generation." + "\n" + 
    						"2 Of every clean beast thou shalt take to thee by sevens, the male and his female: and of beasts that are not clean by two, the male and his female." + "\n" + 
    						"3 Of fowls also of the air by sevens, the male and the female; to keep seed alive upon the face of all the earth." + "\n" + 
    						"4 For yet seven days, and I will cause it to rain upon the earth forty days and forty nights; and every living substance that I have made will I destroy from off the face of the earth." + "\n" + 
    						"5 And Noah did according unto all that the LORD commanded him." + "\n" + 
    						"6 And Noah was six hundred years old when the flood of waters was upon the earth." + "\n" + 
    						"7 And Noah went in, and his sons, and his wife, and his sons' wives with him, into the ark, because of the waters of the flood." + "\n" + 
    						"8 Of clean beasts, and of beasts that are not clean, and of fowls, and of every thing that creepeth upon the earth," + "\n" + 
    						"9 There went in two and two unto Noah into the ark, the male and the female, as God had commanded Noah." + "\n" + 
    						"10 And it came to pass after seven days, that the waters of the flood were upon the earth." + "\n" + 
    						"11 In the six hundredth year of Noah's life, in the second month, the seventeenth day of the month, the same day were all the fountains of the great deep broken up, and the windows of heaven were opened." + "\n" + 
    						"12 And the rain was upon the earth forty days and forty nights." + "\n" + 
    						"13 In the selfsame day entered Noah, and Shem, and Ham, and Japheth, the sons of Noah, and Noah's wife, and the three wives of his sons with them, into the ark;" + "\n" + 
    						"14 They, and every beast after his kind, and all the cattle after their kind, and every creeping thing that creepeth upon the earth after his kind, and every fowl after his kind, every bird of every sort." + "\n" + 
    						"15 And they went in unto Noah into the ark, two and two of all flesh, wherein is the breath of life." + "\n" + 
    						"16 And they that went in, went in male and female of all flesh, as God had commanded him: and the LORD shut him in." + "\n" + 
    						"17 And the flood was forty days upon the earth; and the waters increased, and bare up the ark, and it was lift up above the earth." + "\n" + 
    						"18 And the waters prevailed, and were increased greatly upon the earth; and the ark went upon the face of the waters." + "\n" + 
    						"19 And the waters prevailed exceedingly upon the earth; and all the high hills, that were under the whole heaven, were covered." + "\n" + 
    						"20 Fifteen cubits upward did the waters prevail; and the mountains were covered." + "\n" + 
    						"21 And all flesh died that moved upon the earth, both of fowl, and of cattle, and of beast, and of every creeping thing that creepeth upon the earth, and every man:" + "\n" + 
    						"22 All in whose nostrils was the breath of life, of all that was in the dry land, died." + "\n" + 
    						"23 And every living substance was destroyed which was upon the face of the ground, both man, and cattle, and the creeping things, and the fowl of the heaven; and they were destroyed from the earth: and Noah only remained alive, and they that were with him in the ark." + "\n" + 
    						"24 And the waters prevailed upon the earth an hundred and fifty days.";
    						textArea.setText(genChap7);
     
    						Object[] Genesis7=  {"Search" , "Ok"};
    						int a = JOptionPane.showOptionDialog(frameG,
    								"Enter text to begin search.",
    								"This checks to see if the text you entered is in chapter",
    								JOptionPane.YES_NO_OPTION,
    								JOptionPane.QUESTION_MESSAGE,
    								null,        Genesis7,     Genesis7[0]); 
    						if (a == JOptionPane.YES_OPTION) 
    						{ // beginning of if
    							// clicks on Chapter Two button and opens chapter 2, I hope
    							String inputStr;
    							inputStr = JOptionPane.showInputDialog(null,"Search");
    							if (genChap7.contains(inputStr) == true)
    							{ // beginning of if
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " is in chapter" , "Search item found", +  JOptionPane.INFORMATION_MESSAGE);
    							}  // end of if
    							else 
    							{ // beginning of else
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " isn't in chapter" , "Search item not found", +  JOptionPane.ERROR_MESSAGE);
     
    							} // end of else
     
    						} // end of if
     
    						else if (a == JOptionPane.NO_OPTION)
    						{ // beginning of else if
     
    							// does nothing
    						} // end of else if
    					}
    				});
     
    		chap8.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
    						String genChap8 = "Genesis Chapter Eight" + "\n" +
    						"1     ¶ And God remembered Noah, and every living thing, and all the cattle that was with him in the ark: and God made a wind to pass over the earth, and the waters asswaged;" + "\n" +
    						"2     The fountains also of the deep and the windows of heaven were stopped, and the rain from heaven was restrained;" + "\n" +
    						"3     And the waters returned from off the earth continually: and after the end of the hundred and fifty days the waters were abated." + "\n" +
    						"4     ¶ And the ark rested in the seventh month, on the seventeenth day of the month, upon the mountains of Ararat." + "\n" +
    						"5     And the waters decreased continually until the tenth month: in the tenth month, on the first day of the month, were the tops of the mountains seen." + "\n" +
    						"6     ¶ And it came to pass at the end of forty days, that Noah opened the window of the ark which he had made:" + "\n" +
    						"7     And he sent forth a raven, which went forth to and fro, until the waters were dried up from off the earth." + "\n" +
    						"8     Also he sent forth a dove from him, to see if the waters were abated from off the face of the ground;" + "\n" +
    						"9     But the dove found no rest for the sole of her foot, and she returned unto him into the ark, for the waters were on the face of the whole earth: then he put forth his hand, and took her, and pulled her in unto him into the ark." + "\n" +
    						"10     And he stayed yet other seven days; and again he sent forth the dove out of the ark;" + "\n" +
    						"11     And the dove came in to him in the evening; and, lo, in her mouth was an olive leaf pluckt off: so Noah knew that the waters were abated from off the earth." + "\n" +
    						"12     And he stayed yet other seven days; and sent forth the dove; which returned not again unto him any more." + "\n" +
    						"13     ¶ And it came to pass in the six hundredth and first year, in the first month, the first day of the month, the waters were dried up from off the earth: and Noah removed the covering of the ark, and looked, and, behold, the face of the ground was dry." + "\n" +
    						"14     And in the second month, on the seven and twentieth day of the month, was the earth dried." + "\n" +
    						"15     ¶ And God spake unto Noah, saying," + "\n" +
    						"16     Go forth of the ark, thou, and thy wife, and thy sons, and thy sons' wives with thee." + "\n" +
    						"17     Bring forth with thee every living thing that is with thee, of all flesh, both of fowl, and of cattle, and of every creeping thing that creepeth upon the earth; that they may breed abundantly in the earth, and be fruitful, and multiply upon the earth." + "\n" +
    						"18     And Noah went forth, and his sons, and his wife, and his sons' wives with him:" + "\n" +
    						"19     Every beast, every creeping thing, and every fowl, and whatsoever creepeth upon the earth, after their kinds, went forth out of the ark." + "\n" +
    						"20     ¶ And Noah builded an altar unto the LORD; and took of every clean beast, and of every clean fowl, and offered burnt offerings on the altar." + "\n" +
    						"21     And the LORD smelled a sweet savour; and the LORD said in his heart, I will not again curse the ground any more for man's sake; for the imagination of man's heart is evil from his youth; neither will I again smite any more every thing living, as I have done." + "\n" +
    						"22     While the earth remaineth, seedtime and harvest, and cold and heat, and summer and winter, and day and night shall not cease. ";
     
    						textArea.setText(genChap8);
     
    						Object[] Genesis8=  {"Search" , "Ok"};
    						int a = JOptionPane.showOptionDialog(frameG,
    								"Enter text to begin search.",
    								"This checks to see if the text you entered is in chapter",
    								JOptionPane.YES_NO_OPTION,
    								JOptionPane.QUESTION_MESSAGE,
    								null,        Genesis8,     Genesis8[0]); 
    						if (a == JOptionPane.YES_OPTION) 
    						{ // beginning of if
    							// clicks on Chapter Two button and opens chapter 2, I hope
    							String inputStr;
    							inputStr = JOptionPane.showInputDialog(null,"Search");
    							if (genChap8.contains(inputStr) == true)
    							{ // beginning of if
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " is in chapter" , "Search item found", +  JOptionPane.INFORMATION_MESSAGE);
    							}  // end of if
    							else 
    							{ // beginning of else
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " isn't in chapter" , "Search item not found", +  JOptionPane.ERROR_MESSAGE);
     
    							} // end of else
     
    						} // end of if
     
    						else if (a == JOptionPane.NO_OPTION)
    						{ // beginning of else if
     
    							// does nothing
    						} // end of else if
    					}
    				});
     
    		panel2.add(copy);
    		panel2.add(chap1);
    		panel2.add(chap2);
    		panel2.add(chap3);
    		panel2.add(chap4);
    		panel2.add(chap5);
    		panel2.add(chap6);
    		panel2.add(chap7);
    		panel2.add(chap8);
    		panel2.add(chap9);
    		panel2.add(chap10);
    		panel2.add(chap11);
    		panel2.add(chap12);
    		panel2.add(chap13);
    		panel2.add(chap14);
    		panel2.add(chap15);
    		panel2.add(chap16);
    		panel2.add(chap17);
    		panel2.add(chap18);
    		panel2.add(chap19);
    		panel2.add(chap20);
    		panel2.add(chap21);
    		panel2.add(chap22);
    		panel2.add(chap23);
    		panel2.add(chap24);
    		panel2.add(chap25);
    		panel2.add(chap26);
    		panel2.add(chap27);
    		panel2.add(chap28);
    		panel2.add(chap29);
    		panel2.add(chap30);
    		panel2.add(chap31);
    		panel2.add(chap32);
    		panel2.add(chap33);
    		panel2.add(chap34);
    		panel2.add(chap35);
    		panel2.add(chap36);
    		panel2.add(chap37);
    		panel2.add(chap38);
    		panel2.add(chap39);
    		panel2.add(chap40);
    		panel2.add(chap41);
    		panel2.add(chap42);
    		panel2.add(chap43);
    		panel2.add(chap44);
    		panel2.add(chap45);
    		panel2.add(chap46);
    		panel2.add(chap47);
    		panel2.add(chap48);
    		panel2.add(chap49);
    		panel2.add(chap50);
    		getContentPane().add(panel2);
    	}
    	public void showGUI2(){
    		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		setSize(200,200);
     
    		setLocation(300,300);
    		setVisible(true);
    	}
     
     
     
    }
     
    class ExoWindow extends JFrame
    {
    	JButton exChap1, exChap2, exChap3, exChap4, exChap5, exChap6, exChap7, exChap8, exChap9, exChap10, exChap11, exChap12, exChap13, exChap14,
    	exChap15, exChap16, exChap17, exChap18, exChap19, exChap20, exChap21, exChap22, exChap23, exChap24, exChap25, exChap26, exChap27,
    	exChap28, exChap29, exChap30, exChap31, exChap32, exChap33, exChap34, exChap35, exChap36, exChap37, exChap38, exChap39, exChap40, copy;
     
    	JPanel panel3;
     
    	JFrame frameEx;
     
    	JTextArea textArea2;
    	JScrollPane scroll2;
    	JScrollBar bar, bar2;
     
     
    	public ExoWindow() 
    	{
     
    		setTitle("Exodus");
     
    		exChap1 = new JButton("Chapter One");
    		exChap2 = new JButton ("Chapter Two");
    		exChap3 = new JButton("Chapter Three");
    		exChap4 = new JButton("Chapter Four");
    		exChap5 = new JButton("Chapter Five");
    		exChap6 = new JButton("Chapter Six");
    		exChap7 = new JButton("Chapter Seven");
    		exChap8 = new JButton("Chapter Eight");
    		exChap9 = new JButton("Chapter Nine");
    		exChap10 = new JButton("Chapter Ten");
    		exChap11 = new JButton("Chapter Eleven");
    		exChap12 = new JButton("Chapter Twelve");
    		exChap13 = new JButton("Chapter Thirteen");
    		exChap14 = new JButton("Chapter Fourteen");
    		exChap15 = new JButton("Chapter Fifteen");
    		exChap16 = new JButton ("Chapter Sixteen");
    		exChap17 = new JButton("Chapter Seventeen");
    		exChap18 = new JButton("Chapter Eighteen");
    		exChap19 = new JButton("Chapter Nineteen");
    		exChap20 = new JButton("Chapter Twenty");
    		exChap21 = new JButton("Chapter Twenty-one");
    		exChap22 = new JButton("Chapter Twenty-two");
    		exChap23 = new JButton ("Chapter Twenty-three");
    		exChap24 = new JButton("Chapter Twenty-four");
    		exChap25 = new JButton("Chapter Twenty-five");
    		exChap26 = new JButton("Chapter Twenty-six");
    		exChap27 = new JButton("Chapter Twenty-seven");
    		exChap28 = new JButton("Chapter Twenty-eight");
    		exChap29 = new JButton("Chapter Twenty-nine");
    		exChap30 = new JButton("Chapter Thirty");
    		exChap31 = new JButton("Chapter Thirty-one");
    		exChap32 = new JButton("Chapter Thirty-two");
    		exChap33 = new JButton("Chapter Thirty-three");
    		exChap34 = new JButton("Chapter Thirty-four");
    		exChap35 = new JButton("Chapter Thirty-five");
    		exChap36 = new JButton("Chapter Thirty-six");
    		exChap37 = new JButton("Chapter Thirty-seven");
    		exChap38 = new JButton("Chapter Thirty-eight");
    		exChap39 = new JButton("Chapter Thirty-nine");
    		exChap40 = new JButton("Chapter Forty");
    		copy = new JButton("Copy");
    		Color blue = new Color(0, 0, 125);
     
    		bar = new JScrollBar(JScrollBar.VERTICAL, 30, 20, 0, 300);
    		bar.setVisible(true);
    		// panel3.add(bar);
    		bar.setBlockIncrement(1);
    		bar.setUnitIncrement(2);
     
    		bar2 = new JScrollBar(Adjustable.HORIZONTAL, 30, 40, 0, 300);
    		// panel3.add(bar2);
    		bar2.setBlockIncrement(1);
    		bar2.setUnitIncrement(2);
    		panel3 = new JPanel();
    		bar.setVisible(true);
    		panel3.add(bar);
    		 panel3.add(bar2);
    		bar.setEnabled(true);
    		bar2.setEnabled(true);
    		bar.setSize(200, 200);
            bar2.setSize(30, 100);
            bar2.setLocation(0, 5);
    		int x = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
    		int y = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
    		textArea2 = new JTextArea(25, 25);
    		textArea2.setEditable(false);
    		scroll2 = new JScrollPane(textArea2, x, y);
    		scroll2.setVisible(true);
    		panel3.add(scroll2);
     
    		//panel3.setLayout(new BorderLayout(100, 100));
            panel3.add(bar, BorderLayout.EAST);
     
     
     
     
     
    		copy.addActionListener(
    				new ActionListener()
    				{
    					public void actionPerformed(ActionEvent e)
    					{
    						textArea2.copy();
    					}
    				}
    		);
     
    		exChap1.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
    						String exChap1 = "Exodus Chapter One" + "\n" + 
    						"1     ¶ Now these are the names of the children of Israel, which came into Egypt; every man and his household came with Jacob." + "\n" + 
    						"2     Reuben, Simeon, Levi, and Judah," + "\n" + 
    						"3     Issachar, Zebulun, and Benjamin,"  + "\n" +
    						"4     Dan, and Naphtali, Gad, and Asher."  + "\n" +
    						"5     And all the souls that came out of the loins of Jacob were seventy souls: for Joseph was in Egypt already."  + "\n" +
    						"6     And Joseph died, and all his brethren, and all that generation."  + "\n" +
    						"7     And the children of Israel were fruitful, and increased abundantly, and multiplied, and waxed exceeding mighty; and the land was filled with them."  + "\n" +
    						"8     ¶ Now there arose up a new king over Egypt, which knew not Joseph."  + "\n" +
    						"9     And he said unto his people, Behold, the people of the children of Israel are more and mightier than we:"  + "\n" +
    						"10     Come on, let us deal wisely with them; lest they multiply, and it come to pass, that, when there falleth out any war, they join also unto our enemies, and fight against us, and so get them up out of the land."  + "\n" +
    						"11     Therefore they did set over them taskmasters to afflict them with their burdens. And they built for Pharaoh treasure cities, Pithom and Raamses."  + "\n" +
    						"12     But the more they afflicted them, the more they multiplied and grew. And they were grieved because of the children of Israel."  + "\n" +
    						"13     And the Egyptians made the children of Israel to serve with rigour:"  + "\n" +
    						"14     And they made their lives bitter with hard bondage, in morter, and in brick, and in all manner of service in the field: all their service, wherein they made them serve, was with rigour."  + "\n" +
    						"15     ¶ And the king of Egypt spake to the Hebrew midwives, of which the name of the one was Shiphrah, and the name of the other Puah:"  + "\n" +
    						"16     And he said, When ye do the office of a midwife to the Hebrew women, and see them upon the stools; if it be a son, then ye shall kill him: but if it be a daughter, then she shall live."  + "\n" +
    						"17     But the midwives feared God, and did not as the king of Egypt commanded them, but saved the men children alive."  + "\n" +
    						"18     And the king of Egypt called for the midwives, and said unto them, Why have ye done this thing, and have saved the men children alive?"  + "\n" +
    						"19     And the midwives said unto Pharaoh, Because the Hebrew women are not as the Egyptian women; for they are lively, and are delivered ere the midwives come in unto them."  + "\n" +
    						"20     Therefore God dealt well with the midwives: and the people multiplied, and waxed very mighty."  + "\n" +
    						"21     And it came to pass, because the midwives feared God, that he made them houses."  + "\n" +
    						"22     And Pharaoh charged all his people, saying, Every son that is born ye shall cast into the river, and every daughter ye shall save alive.";
    						// System.out.println(exChap1);
    						textArea2.setText(exChap1);
     
    						Object[] Exodus1 = { "Search", "Ok"};
    						int a = JOptionPane.showOptionDialog(frameEx,
    								"Enter text to begin search.",
    								"This checks to see if the text you entered is in chapter",  JOptionPane.YES_NO_OPTION,
    								JOptionPane.QUESTION_MESSAGE,
    								null,        Exodus1,     Exodus1[0]); 
     
     
     
     
     
    						if ( a == JOptionPane.YES_OPTION)
    						{ // beginning of if
    							String inputStr;
    							inputStr = JOptionPane.showInputDialog(null,"Search");
    							if (exChap1.contains(inputStr) == true)
    							{ // beginning of if
    								//  System.out.println("'" + inputStr + "'" + " is in chapter");
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " is in chapter" , "Search item found", +  JOptionPane.INFORMATION_MESSAGE);
    							} // end of if
    							else
    							{ // beginning of else
    								// System.out.println("'" + inputStr + "'" + " isn't in chapter");
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " isn't in chapter" , "Search item not found", +  JOptionPane.ERROR_MESSAGE);
    							} // end of else
     
    						} // end of if
    						else if (a == JOptionPane.NO_OPTION)
    						{
    							// does nothing
     
    						}
     
    					}
    				});
     
    		exChap2.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
     
    						String exChap2 = "Exodus Chapter Two" + "\n" +
    						"1     ¶ And there went a man of the house of Levi, and took to wife a daughter of Levi." + "\n" +
    						"2     And the woman conceived, and bare a son: and when she saw him that he was a goodly child, she hid him three months." + "\n" +
    						"3     And when she could not longer hide him, she took for him an ark of bulrushes, and daubed it with slime and with pitch, and put the child therein; and she laid it in the flags by the river's brink." + "\n" +
    						"4     And his sister stood afar off, to wit what would be done to him." + "\n" +
    						"5     ¶ And the daughter of Pharaoh came down to wash herself at the river; and her maidens walked along by the river's side; and when she saw the ark among the flags, she sent her maid to fetch it." + "\n" +
    						"6     And when she had opened it, she saw the child: and, behold, the babe wept. And she had compassion on him, and said, This is one of the Hebrews' children." + "\n" +
    						"7     Then said his sister to Pharaoh's daughter, Shall I go and call to thee a nurse of the Hebrew women, that she may nurse the child for thee?" + "\n" +
    						"8     And Pharaoh's daughter said to her, Go. And the maid went and called the child's mother." + "\n" +
    						"9     And Pharaoh's daughter said unto her, Take this child away, and nurse it for me, and I will give thee thy wages. And the woman took the child, and nursed it." + "\n" +
    						"10     And the child grew, and she brought him unto Pharaoh's daughter, and he became her son. And she called his name Moses: and she said, Because I drew him out of the water." + "\n" +
    						"11     ¶ And it came to pass in those days, when Moses was grown, that he went out unto his brethren, and looked on their burdens: and he spied an Egyptian smiting an Hebrew, one of his brethren." + "\n" +
    						"12     And he looked this way and that way, and when he saw that there was no man, he slew the Egyptian, and hid him in the sand." + "\n" +
    						"13     And when he went out the second day, behold, two men of the Hebrews strove together: and he said to him that did the wrong, Wherefore smitest thou thy fellow?" + "\n" +
    						"14     And he said, Who made thee a prince and a judge over us? intendest thou to kill me, as thou killedst the Egyptian? And Moses feared, and said, Surely this thing is known." + "\n" +
    						"15     Now when Pharaoh heard this thing, he sought to slay Moses. But Moses fled from the face of Pharaoh, and dwelt in the land of Midian: and he sat down by a well." + "\n" +
    						"16     ¶ Now the priest of Midian had seven daughters: and they came and drew water, and filled the troughs to water their father's flock." + "\n" +
    						"17     And the shepherds came and drove them away: but Moses stood up and helped them, and watered their flock." + "\n" +
    						"18     And when they came to Reuel their father, he said, How is it that ye are come so soon to day?" + "\n" +
    						"19     And they said, An Egyptian delivered us out of the hand of the shepherds, and also drew water enough for us, and watered the flock." + "\n" +
    						"20     And he said unto his daughters, And where is he? why is it that ye have left the man? call him, that he may eat bread." + "\n" +
    						"21     And Moses was content to dwell with the man: and he gave Moses Zipporah his daughter." + "\n" +
    						"22     And she bare him a son, and he called his name Gershom: for he said, I have been a stranger in a strange land." + "\n" +
    						"23     ¶ And it came to pass in process of time, that the king of Egypt died: and the children of Israel sighed by reason of the bondage, and they cried, and their cry came up unto God by reason of the bondage." + "\n" +
    						"24     And God heard their groaning, and God remembered his covenant with Abraham, with Isaac, and with Jacob." + "\n" +
    						"25     And God looked upon the children of Israel, and God had respect unto them.";
     
    						textArea2.setText(exChap2);
     
    						Object[] Exodus2 = { "Search", "Ok"};
    						int a = JOptionPane.showOptionDialog(frameEx,
    								"Enter text to begin search.",
    								"This checks to see if the text you entered is in chapter",  JOptionPane.YES_NO_OPTION,
    								JOptionPane.QUESTION_MESSAGE,
    								null,        Exodus2,     Exodus2[0]); 
     
     
     
     
     
    						if ( a == JOptionPane.YES_OPTION)
    						{ // beginning of if
    							String inputStr;
    							inputStr = JOptionPane.showInputDialog(null,"Search");
    							if (exChap2.contains(inputStr) == true)
    							{ // beginning of if
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " is in chapter" , "Search item found", +  JOptionPane.INFORMATION_MESSAGE);
    							} // end of if
    							else
    							{ // beginning of else
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " isn't in chapter" , "Search item not found", +  JOptionPane.ERROR_MESSAGE);
    							} // end of else
     
    						} // end of if
    						else if (a == JOptionPane.NO_OPTION)
    						{
    							// does nothing
     
    						}
     
    					}
    				});
     
    		exChap3.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
     
    						String exChap3 = "Genesis Chapter Three" + "\n" +
    						"1     ¶ Now Moses kept the flock of Jethro his father in law, the priest of Midian: and he led the flock to the backside of the desert, and came to the mountain of God, even to Horeb." + "\n" +
    						"2     And the angel of the LORD appeared unto him in a flame of fire out of the midst of a bush: and he looked, and, behold, the bush burned with fire, and the bush was not consumed." + "\n" +
    						"3     And Moses said, I will now turn aside, and see this great sight, why the bush is not burnt." + "\n" +
    						"4     And when the LORD saw that he turned aside to see, God called unto him out of the midst of the bush, and said, Moses, Moses. And he said, Here am I." + "\n" +
    						"5     And he said, Draw not nigh hither: put off thy shoes from off thy feet, for the place whereon thou standest is holy ground." + "\n" +
    						"6     Moreover he said, I am the God of thy father, the God of Abraham, the God of Isaac, and the God of Jacob. And Moses hid his face; for he was afraid to look upon God." + "\n" +
    						"7     ¶ And the LORD said, I have surely seen the affliction of my people which are in Egypt, and have heard their cry by reason of their taskmasters; for I know their sorrows;" + "\n" +
    						"8     And I am come down to deliver them out of the hand of the Egyptians, and to bring them up out of that land unto a good land and a large, unto a land flowing with milk and honey; unto the place of the Canaanites, and the Hittites, and the Amorites, and the Perizzites, and the Hivites, and the Jebusites." + "\n" +
    						"9     Now therefore, behold, the cry of the children of Israel is come unto me: and I have also seen the oppression wherewith the Egyptians oppress them." + "\n" +
    						"10     Come now therefore, and I will send thee unto Pharaoh, that thou mayest bring forth my people the children of Israel out of Egypt." + "\n" +
    						"11     ¶ And Moses said unto God, Who am I, that I should go unto Pharaoh, and that I should bring forth the children of Israel out of Egypt?" + "\n" +
    						"12     And he said, Certainly I will be with thee; and this shall be a token unto thee, that I have sent thee: When thou hast brought forth the people out of Egypt, ye shall serve God upon this mountain." + "\n" +
    						"13     And Moses said unto God, Behold, when I come unto the children of Israel, and shall say unto them, The God of your fathers hath sent me unto you; and they shall say to me, What is his name? what shall I say unto them?" + "\n" +
    						"14     And God said unto Moses, I AM THAT I AM: and he said, Thus shalt thou say unto the children of Israel, I AM hath sent me unto you." + "\n" +
    						"15     And God said moreover unto Moses, Thus shalt thou say unto the children of Israel, The LORD God of your fathers, the God of Abraham, the God of Isaac, and the God of Jacob, hath sent me unto you: this is my name for ever, and this is my memorial unto all generations." + "\n" +
    						"16     ¶ Go, and gather the elders of Israel together, and say unto them, The LORD God of your fathers, the God of Abraham, of Isaac, and of Jacob, appeared unto me, saying, I have surely visited you, and seen that which is done to you in Egypt:" + "\n" +
    						"17     And I have said, I will bring you up out of the affliction of Egypt unto the land of the Canaanites, and the Hittites, and the Amorites, and the Perizzites, and the Hivites, and the Jebusites, unto a land flowing with milk and honey." + "\n" +
    						"18     And they shall hearken to thy voice: and thou shalt come, thou and the elders of Israel, unto the king of Egypt, and ye shall say unto him, The LORD God of the Hebrews hath met with us: and now let us go, we beseech thee, three days' journey into the wilderness, that we may sacrifice to the LORD our God." + "\n" +
    						"19     And I am sure that the king of Egypt will not let you go, no, not by a mighty hand." + "\n" +
    						"20     And I will stretch out my hand, and smite Egypt with all my wonders which I will do in the midst thereof: and after that he will let you go." + "\n" +
    						"21     And I will give this people favour in the sight of the Egyptians: and it shall come to pass, that, when ye go, ye shall not go empty:" + "\n" +
    						"22     But every woman shall borrow of her neighbour, and of her that sojourneth in her house, jewels of silver, and jewels of gold, and raiment: and ye shall put them upon your sons, and upon your daughters; and ye shall spoil the Egyptians.";
     
    						textArea2.setText(exChap3);
     
    						Object[] Exodus3 = { "Search", "Ok"};
    						int a = JOptionPane.showOptionDialog(frameEx,
    								"Enter text to begin search.",
    								"This checks to see if the text you entered is in chapter",  JOptionPane.YES_NO_OPTION,
    								JOptionPane.QUESTION_MESSAGE,
    								null,        Exodus3,     Exodus3[0]); 
     
    						if ( a == JOptionPane.YES_OPTION)
    						{ // beginning of if
    							String inputStr;
    							inputStr = JOptionPane.showInputDialog(null,"Search");
    							if (exChap3.contains(inputStr) == true)
    							{ // beginning of if
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " is in chapter" , "Search item found", +  JOptionPane.INFORMATION_MESSAGE);
    							} // end of if
    							else
    							{ // beginning of else
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " isn't in chapter" , "Search item not found", +  JOptionPane.ERROR_MESSAGE);
    							} // end of else
     
    						} // end of if
    						else if (a == JOptionPane.NO_OPTION)
    						{
    							// does nothing
     
    						}
     
    					}
    				});
     
    		exChap4.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
     
    						String exChap4 = "Exodus Chapter Four" + "\n" +
    						"1     ¶ And Moses answered and said, But, behold, they will not believe me, nor hearken unto my voice: for they will say, The LORD hath not appeared unto thee." + "\n" +
    						"2     And the LORD said unto him, What is that in thine hand? And he said, A rod." + "\n" +
    						"3     And he said, Cast it on the ground. And he cast it on the ground, and it became a serpent; and Moses fled from before it." + "\n" +
    						"4     And the LORD said unto Moses, Put forth thine hand, and take it by the tail. And he put forth his hand, and caught it, and it became a rod in his hand:" + "\n" +
    						"5     That they may believe that the LORD God of their fathers, the God of Abraham, the God of Isaac, and the God of Jacob, hath appeared unto thee." + "\n" +
    						"6     And the LORD said furthermore unto him, Put now thine hand into thy bosom. And he put his hand into his bosom: and when he took it out, behold, his hand was leprous as snow." + "\n" +
    						"7     And he said, Put thine hand into thy bosom again. And he put his hand into his bosom again; and plucked it out of his bosom, and, behold, it was turned again as his other flesh." + "\n" +
    						"8     And it shall come to pass, if they will not believe thee, neither hearken to the voice of the first sign, that they will believe the voice of the latter sign." + "\n" +
    						"9     And it shall come to pass, if they will not believe also these two signs, neither hearken unto thy voice, that thou shalt take of the water of the river, and pour it upon the dry land: and the water which thou takest out of the river shall become blood upon the dry land." + "\n" +
    						"10     ¶ And Moses said unto the LORD, O my Lord, I am not eloquent, neither heretofore, nor since thou hast spoken unto thy servant: but I am slow of speech, and of a slow tongue." + "\n" +
    						"11     And the LORD said unto him, Who hath made man's mouth? or who maketh the dumb, or deaf, or the seeing, or the blind? have not I the LORD?" + "\n" +
    						"12     Now therefore go, and I will be with thy mouth, and teach thee what thou shalt say." + "\n" +
    						"13     And he said, O my Lord, send, I pray thee, by the hand of him whom thou wilt send." + "\n" +
    						"14     And the anger of the LORD was kindled against Moses, and he said, Is not Aaron the Levite thy brother? I know that he can speak well. And also, behold, he cometh forth to meet thee: and when he seeth thee, he will be glad in his heart." + "\n" +
    						"15     And thou shalt speak unto him, and put words in his mouth: and I will be with thy mouth, and with his mouth, and will teach you what ye shall do." + "\n" +
    						"16     And he shall be thy spokesman unto the people: and he shall be, even he shall be to thee instead of a mouth, and thou shalt be to him instead of God." + "\n" +
    						"17     And thou shalt take this rod in thine hand, wherewith thou shalt do signs." + "\n" +
    						"18     ¶ And Moses went and returned to Jethro his father in law, and said unto him, Let me go, I pray thee, and return unto my brethren which are in Egypt, and see whether they be yet alive. And Jethro said to Moses, Go in peace." + "\n" +
    						"19     And the LORD said unto Moses in Midian, Go, return into Egypt: for all the men are dead which sought thy life." + "\n" +
    						"20     And Moses took his wife and his sons, and set them upon an ass, and he returned to the land of Egypt: and Moses took the rod of God in his hand." + "\n" +
    						"21     And the LORD said unto Moses, When thou goest to return into Egypt, see that thou do all those wonders before Pharaoh, which I have put in thine hand: but I will harden his heart, that he shall not let the people go." + "\n" +
    						"22     And thou shalt say unto Pharaoh, Thus saith the LORD, Israel is my son, even my firstborn:" + "\n" +
    						"23     And I say unto thee, Let my son go, that he may serve me: and if thou refuse to let him go, behold, I will slay thy son, even thy firstborn." + "\n" +
    						"24     ¶ And it came to pass by the way in the inn, that the LORD met him, and sought to kill him." + "\n" +
    						"25     Then Zipporah took a sharp stone, and cut off the foreskin of her son, and cast it at his feet, and said, Surely a bloody husband art thou to me." + "\n" +
    						"26     So he let him go: then she said, A bloody husband thou art, because of the circumcision." + "\n" +
    						"27     And the LORD said to Aaron, Go into the wilderness to meet Moses. And he went, and met him in the mount of God, and kissed him." + "\n" +
    						"28     And Moses told Aaron all the words of the LORD who had sent him, and all the signs which he had commanded him." + "\n" +
    						"29     And Moses and Aaron went and gathered together all the elders of the children of Israel:" + "\n" +
    						"30     And Aaron spake all the words which the LORD had spoken unto Moses, and did the signs in the sight of the people." + "\n" +
    						"31     And the people believed: and when they heard that the LORD had visited the children of Israel, and that he had looked upon their affliction, then they bowed their heads and worshipped.";
     
    						textArea2.setText(exChap4);
     
    						Object[] Exodus4 = { "Search", "Ok"};
    						int a = JOptionPane.showOptionDialog(frameEx,
    								"Enter text to begin search.",
    								"This checks to see if the text you entered is in chapter",  JOptionPane.YES_NO_OPTION,
    								JOptionPane.QUESTION_MESSAGE,
    								null,        Exodus4,     Exodus4[0]); 
     
    						if ( a == JOptionPane.YES_OPTION)
    						{ // beginning of if
    							String inputStr;
    							inputStr = JOptionPane.showInputDialog(null,"Search");
    							if (exChap4.contains(inputStr) == true)
    							{ // beginning of if
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " is in chapter" , "Search item found", +  JOptionPane.INFORMATION_MESSAGE);
    							} // end of if
    							else
    							{ // beginning of else
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " isn't in chapter" , "Search item not found", +  JOptionPane.ERROR_MESSAGE);
    							} // end of else
     
    						} // end of if
    						else if (a == JOptionPane.NO_OPTION)
    						{
    							// does nothing
     
    						}
     
    					}
    				});
     
    		exChap5.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
     
    						String exChap5 = "Exodus Chapter Five" + "\n" +
    						"1     ¶ And afterward Moses and Aaron went in, and told Pharaoh, Thus saith the LORD God of Israel, Let my people go, that they may hold a feast unto me in the wilderness." + "\n" +
    						"2     And Pharaoh said, Who is the LORD, that I should obey his voice to let Israel go? I know not the LORD, neither will I let Israel go." + "\n" +
    						"3     ¶ And they said, The God of the Hebrews hath met with us: let us go, we pray thee, three days' journey into the desert, and sacrifice unto the LORD our God; lest he fall upon us with pestilence, or with the sword." + "\n" +
    						"4     And the king of Egypt said unto them, Wherefore do ye, Moses and Aaron, let the people from their works? get you unto your burdens." + "\n" +
    						"5     And Pharaoh said, Behold, the people of the land now are many, and ye make them rest from their burdens." + "\n" +
    						"6     And Pharaoh commanded the same day the taskmasters of the people, and their officers, saying," + "\n" +
    						"7     Ye shall no more give the people straw to make brick, as heretofore: let them go and gather straw for themselves." + "\n" +
    						"8     And the tale of the bricks, which they did make heretofore, ye shall lay upon them; ye shall not diminish ought thereof: for they be idle; therefore they cry, saying, Let us go and sacrifice to our God." + "\n" +
    						"9     Let there more work be laid upon the men, that they may labour therein; and let them not regard vain words." + "\n" +
    						"10     ¶ And the taskmasters of the people went out, and their officers, and they spake to the people, saying, Thus saith Pharaoh, I will not give you straw." + "\n" +
    						"11     Go ye, get you straw where ye can find it: yet not ought of your work shall be diminished." + "\n" +
    						"12     So the people were scattered abroad throughout all the land of Egypt to gather stubble instead of straw." + "\n" +
    						"13     And the taskmasters hasted them, saying, Fulfil your works, your daily tasks, as when there was straw." + "\n" +
    						"14     And the officers of the children of Israel, which Pharaoh's taskmasters had set over them, were beaten, and demanded, Wherefore have ye not fulfilled your task in making brick both yesterday and to day, as heretofore?" + "\n" +
    						"15     ¶ Then the officers of the children of Israel came and cried unto Pharaoh, saying, Wherefore dealest thou thus with thy servants?" + "\n" +
    						"16     There is no straw given unto thy servants, and they say to us, Make brick: and, behold, thy servants are beaten; but the fault is in thine own people." + "\n" +
    						"17     But he said, Ye are idle, ye are idle: therefore ye say, Let us go and do sacrifice to the LORD." + "\n" +
    						"18     Go therefore now, and work; for there shall no straw be given you, yet shall ye deliver the tale of bricks." + "\n" +
    						"19     And the officers of the children of Israel did see that they were in evil case, after it was said, Ye shall not minish ought from your bricks of your daily task." + "\n" +
    						"20     And they met Moses and Aaron, who stood in the way, as they came forth from Pharaoh:" + "\n" +
    						"21     And they said unto them, The LORD look upon you, and judge; because ye have made our savour to be abhorred in the eyes of Pharaoh, and in the eyes of his servants, to put a sword in their hand to slay us." + "\n" +
    						"22     And Moses returned unto the LORD, and said, Lord, wherefore hast thou so evil entreated this people? why is it that thou hast sent me?" + "\n" +
    						"23     For since I came to Pharaoh to speak in thy name, he hath done evil to this people; neither hast thou delivered thy people at all.";
     
    						textArea2.setText(exChap5);
     
    						Object[] Exodus5 = { "Search", "Ok"};
    						int a = JOptionPane.showOptionDialog(frameEx,
    								"Enter text to begin search.",
    								"This checks to see if the text you entered is in chapter",  JOptionPane.YES_NO_OPTION,
    								JOptionPane.QUESTION_MESSAGE,
    								null,        Exodus5,     Exodus5[0]); 
     
    						if ( a == JOptionPane.YES_OPTION)
    						{ // beginning of if
    							String inputStr;
    							inputStr = JOptionPane.showInputDialog(null,"Search");
    							if (exChap5.contains(inputStr) == true)
    							{ // beginning of if
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " is in chapter" , "Search item found", +  JOptionPane.INFORMATION_MESSAGE);
    							} // end of if
    							else
    							{ // beginning of else
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " isn't in chapter" , "Search item not found", +  JOptionPane.ERROR_MESSAGE);
    							} // end of else
     
    						} // end of if
    						else if (a == JOptionPane.NO_OPTION)
    						{
    							// does nothing
     
    						}
     
    					}
    				});
     
    		exChap6.addActionListener(
    				new ActionListener() {
    					public void actionPerformed(ActionEvent e) {
     
    						String exChap6 = "Exodus Chapter Six" + "\n" +
    						"1     ¶ Then the LORD said unto Moses, Now shalt thou see what I will do to Pharaoh: for with a strong hand shall he let them go, and with a strong hand shall he drive them out of his land." + "\n" +
    						"2     And God spake unto Moses, and said unto him, I am the LORD:" + "\n" +
    						"3     And I appeared unto Abraham, unto Isaac, and unto Jacob, by the name of God Almighty, but by my name JEHOVAH was I not known to them." + "\n" +
    						"4     And I have also established my covenant with them, to give them the land of Canaan, the land of their pilgrimage, wherein they were strangers." + "\n" +
    						"5     And I have also heard the groaning of the children of Israel, whom the Egyptians keep in bondage; and I have remembered my covenant." + "\n" +
    						"6     Wherefore say unto the children of Israel, I am the LORD, and I will bring you out from under the burdens of the Egyptians, and I will rid you out of their bondage, and I will redeem you with a stretched out arm, and with great judgments:" + "\n" +
    						"7     And I will take you to me for a people, and I will be to you a God: and ye shall know that I am the LORD your God, which bringeth you out from under the burdens of the Egyptians." + "\n" +
    						"8     And I will bring you in unto the land, concerning the which I did swear to give it to Abraham, to Isaac, and to Jacob; and I will give it you for an heritage: I am the LORD." + "\n" +
    						"9     And Moses spake so unto the children of Israel: but they hearkened not unto Moses for anguish of spirit, and for cruel bondage." + "\n" +
    						"10     ¶ And the LORD spake unto Moses, saying," + "\n" +
    						"11     Go in, speak unto Pharaoh king of Egypt, that he let the children of Israel go out of his land." + "\n" +
    						"12     And Moses spake before the LORD, saying, Behold, the children of Israel have not hearkened unto me; how then shall Pharaoh hear me, who am of uncircumcised lips?" + "\n" +
    						"13     And the LORD spake unto Moses and unto Aaron, and gave them a charge unto the children of Israel, and unto Pharaoh king of Egypt, to bring the children of Israel out of the land of Egypt." + "\n" +
    						"14     ¶ These be the heads of their fathers' houses: The sons of Reuben the firstborn of Israel; Hanoch, and Pallu, Hezron, and Carmi: these be the families of Reuben." + "\n" +
    						"15     And the sons of Simeon; Jemuel, and Jamin, and Ohad, and Jachin, and Zohar, and Shaul the son of a Canaanitish woman: these are the families of Simeon." + "\n" +
    						"16     And these are the names of the sons of Levi according to their generations; Gershon, and Kohath, and Merari: and the years of the life of Levi were an hundred thirty and seven years." + "\n" +
    						"17     The sons of Gershon; Libni, and Shimi, according to their families." + "\n" +
    						"18     And the sons of Kohath; Amram, and Izhar, and Hebron, and Uzziel: and the years of the life of Kohath were an hundred thirty and three years." + "\n" +
    						"19     And the sons of Merari; Mahali and Mushi: these are the families of Levi according to their generations." + "\n" +
    						"20     And Amram took him Jochebed his father's sister to wife; and she bare him Aaron and Moses: and the years of the life of Amram were an hundred and thirty and seven years." + "\n" +
    						"21     And the sons of Izhar; Korah, and Nepheg, and Zichri." + "\n" +
    						"22     And the sons of Uzziel; Mishael, and Elzaphan, and Zithri." + "\n" +
    						"23     And Aaron took him Elisheba, daughter of Amminadab, sister of Naashon, to wife; and she bare him Nadab, and Abihu, Eleazar, and Ithamar." + "\n" +
    						"24     And the sons of Korah; Assir, and Elkanah, and Abiasaph: these are the families of the Korhites." + "\n" +
    						"25     And Eleazar Aaron's son took him one of the daughters of Putiel to wife; and she bare him Phinehas: these are the heads of the fathers of the Levites according to their families." + "\n" +
    						"26     These are that Aaron and Moses, to whom the LORD said, Bring out the children of Israel from the land of Egypt according to their armies." + "\n" +
    						"27     These are they which spake to Pharaoh king of Egypt, to bring out the children of Israel from Egypt: these are that Moses and Aaron." + "\n" +
    						"28     And it came to pass on the day when the LORD spake unto Moses in the land of Egypt," + "\n" +
    						"29     That the LORD spake unto Moses, saying, I am the LORD: speak thou unto Pharaoh king of Egypt all that I say unto thee." + "\n" +
    						"30     And Moses said before the LORD, Behold, I am of uncircumcised lips, and how shall Pharaoh hearken unto me?";		
     
    						textArea2.setText(exChap6);
     
    						Object[] Exodus6 = { "Search", "Ok"};
    						int a = JOptionPane.showOptionDialog(frameEx,
    								"Enter text to begin search.",
    								"This checks to see if the text you entered is in chapter",  JOptionPane.YES_NO_OPTION,
    								JOptionPane.QUESTION_MESSAGE,
    								null,        Exodus6,     Exodus6[0]); 
     
    						if ( a == JOptionPane.YES_OPTION)
    						{ // beginning of if
    							String inputStr;
    							inputStr = JOptionPane.showInputDialog(null,"Search");
    							if (exChap6.contains(inputStr) == true)
    							{ // beginning of if
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " is in chapter" , "Search item found", +  JOptionPane.INFORMATION_MESSAGE);
    							} // end of if
    							else
    							{ // beginning of else
    								JOptionPane.showMessageDialog(null, "'" + inputStr + "'" + " isn't in chapter" , "Search item not found", +  JOptionPane.ERROR_MESSAGE);
    							} // end of else
     
    						} // end of if
    						else if (a == JOptionPane.NO_OPTION)
    						{
    							// does nothing
     
    						}
     
    					}
    				});
     
    		panel3.add(exChap1);
    		panel3.add(exChap2);
    		panel3.add(exChap3);
    		panel3.add(exChap4);
    		panel3.add(exChap5);
    		panel3.add(exChap6);
    		panel3.add(exChap7);
    		panel3.add(exChap8);
    		panel3.add(exChap9);
    		panel3.add(exChap10);
    		panel3.add(exChap11);
    		panel3.add(exChap12);
    		panel3.add(exChap13);
    		panel3.add(exChap14);
    		panel3.add(exChap15);
    		panel3.add(exChap16);
    		panel3.add(exChap17);
    		panel3.add(exChap18);
    		panel3.add(exChap19);
    		panel3.add(exChap20);
    		panel3.add(exChap21);
    		panel3.add(exChap22);
    		panel3.add(exChap23);
    		panel3.add(exChap24);
    		panel3.add(exChap25);
    		panel3.add(exChap26);
    		panel3.add(exChap27);
    		panel3.add(exChap28);
    		panel3.add(exChap29);
    		panel3.add(exChap30);
    		panel3.add(exChap31);
    		panel3.add(exChap32);
    		panel3.add(exChap33);
    		panel3.add(exChap34);
    		panel3.add(exChap35);
    		panel3.add(exChap36);
    		panel3.add(exChap37);
    		panel3.add(exChap38);
    		panel3.add(exChap39);
    		panel3.add(exChap40);
    		panel3.add(copy);
    		getContentPane().add(panel3);
    	}
    	public void showGUI3(){
    		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		setSize(200,200);
    		bar.setVisible(true);
     
    		setLocation(300,300);
    		setVisible(true);
    	}
    }



  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Evil JScrollBars

    Please make a SMALL program that demos the problem. You've post too much code to work with.

  3. The Following User Says Thank You to Norm For This Useful Post:

    javapenguin (June 25th, 2010)

  4. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Evil JScrollBars

    You may consider getting rid of the JButtons entirely, and move on to a JComboBox...it'll reduce all those buttons down into a single component which - because of the reduction - doesn't need to be scrolled.

  5. The Following User Says Thank You to copeg For This Useful Post:

    javapenguin (June 25th, 2010)

  6. #4
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Evil JScrollBars

    Quote Originally Posted by copeg View Post
    You may consider getting rid of the JButtons entirely, and move on to a JComboBox...it'll reduce all those buttons down into a single component which - because of the reduction - doesn't need to be scrolled.
    Clever idea, but that won't help with it taking up so much room that the JTextArea doesn't show.

    I only wanted to add the scroll panes because I wanted to enlarge the text area and still keep all of the buttons. Also, I know how to handle buttons, at least I think I'm starting to get it, but I haven't ever used a JComboBox before.

    I don't know how to add an ActionListener to that one with an array of Objects. It keeps claiming that actionPerformed or whatever is not defined for Object.

  7. #5
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Evil JScrollBars

    Here's where the problem is occurring for the JScrollBar thing.

    class ExoWindow extends JFrame
    {
    	JButton exChap1, exChap2, exChap3, exChap4, exChap5, exChap6, exChap7, exChap8, exChap9, exChap10, exChap11, exChap12, exChap13, exChap14,
    	exChap15, exChap16, exChap17, exChap18, exChap19, exChap20, exChap21, exChap22, exChap23, exChap24, exChap25, exChap26, exChap27,
    	exChap28, exChap29, exChap30, exChap31, exChap32, exChap33, exChap34, exChap35, exChap36, exChap37, exChap38, exChap39, exChap40, copy;
     
    	JPanel panel3;
     
    	JFrame frameEx;
     
    	JTextArea textArea2;
    	JScrollPane scroll2;
    	JScrollBar bar, bar2;
     
     
    	public ExoWindow() 
    	{
     
    		setTitle("Exodus");
     
    		exChap1 = new JButton("Chapter One");
    		exChap2 = new JButton ("Chapter Two");
    		exChap3 = new JButton("Chapter Three");
    		exChap4 = new JButton("Chapter Four");
    		exChap5 = new JButton("Chapter Five");
    		exChap6 = new JButton("Chapter Six");
    		exChap7 = new JButton("Chapter Seven");
    		exChap8 = new JButton("Chapter Eight");
    		exChap9 = new JButton("Chapter Nine");
    		exChap10 = new JButton("Chapter Ten");
    		exChap11 = new JButton("Chapter Eleven");
    		exChap12 = new JButton("Chapter Twelve");
    		exChap13 = new JButton("Chapter Thirteen");
    		exChap14 = new JButton("Chapter Fourteen");
    		exChap15 = new JButton("Chapter Fifteen");
    		exChap16 = new JButton ("Chapter Sixteen");
    		exChap17 = new JButton("Chapter Seventeen");
    		exChap18 = new JButton("Chapter Eighteen");
    		exChap19 = new JButton("Chapter Nineteen");
    		exChap20 = new JButton("Chapter Twenty");
    		exChap21 = new JButton("Chapter Twenty-one");
    		exChap22 = new JButton("Chapter Twenty-two");
    		exChap23 = new JButton ("Chapter Twenty-three");
    		exChap24 = new JButton("Chapter Twenty-four");
    		exChap25 = new JButton("Chapter Twenty-five");
    		exChap26 = new JButton("Chapter Twenty-six");
    		exChap27 = new JButton("Chapter Twenty-seven");
    		exChap28 = new JButton("Chapter Twenty-eight");
    		exChap29 = new JButton("Chapter Twenty-nine");
    		exChap30 = new JButton("Chapter Thirty");
    		exChap31 = new JButton("Chapter Thirty-one");
    		exChap32 = new JButton("Chapter Thirty-two");
    		exChap33 = new JButton("Chapter Thirty-three");
    		exChap34 = new JButton("Chapter Thirty-four");
    		exChap35 = new JButton("Chapter Thirty-five");
    		exChap36 = new JButton("Chapter Thirty-six");
    		exChap37 = new JButton("Chapter Thirty-seven");
    		exChap38 = new JButton("Chapter Thirty-eight");
    		exChap39 = new JButton("Chapter Thirty-nine");
    		exChap40 = new JButton("Chapter Forty");
    		copy = new JButton("Copy");
    		Color blue = new Color(0, 0, 125);
     
    		box = new JComboBox(items);
    		bar = new JScrollBar(JScrollBar.VERTICAL, 30, 20, 0, 300);
    		bar.setVisible(true);
    		// panel3.add(bar);
    		bar.setBlockIncrement(1);
    		bar.setUnitIncrement(2);
     
    		bar2 = new JScrollBar(Adjustable.HORIZONTAL, 30, 40, 0, 300);
    		// panel3.add(bar2);
    		bar2.setBlockIncrement(1);
    		bar2.setUnitIncrement(2);
    		panel3 = new JPanel();
    		bar.setVisible(true);
    		panel3.add(bar);
    		 panel3.add(bar2);
    		bar.setEnabled(true);
    		bar2.setEnabled(true);
    		bar.setSize(200, 200);
            bar2.setSize(30, 100);
            bar2.setLocation(0, 5);
    		int x = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
    		int y = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
    		textArea2 = new JTextArea(25, 25);
    		textArea2.setEditable(false);
    		scroll2 = new JScrollPane(textArea2, x, y);
    		scroll2.setVisible(true);
    		panel3.add(scroll2);
     
    		//panel3.setLayout(new BorderLayout(100, 100));
            panel3.add(bar, BorderLayout.EAST);

  8. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Evil JScrollBars

    where the problem is occurring
    What problem?
    Looks like you're missing some code in what you posted. Is that the problem?
    Last edited by Norm; June 25th, 2010 at 08:49 PM.

  9. #7
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Question Re: Evil JScrollBars

    Quote Originally Posted by Norm View Post
    What problem?
    Looks like you're missing some code in what you posted. Is that the problem?
    If you mean the main method, see longer code. This is just a segment of it, pertaining to the part that isn't doing what I want it to. What code am I missing? BorderLayout? Tried it, but it makes one button take up almost the whole screen, though it does make the scrollbar larger.



    Oh you mean the JComboBox? I didn't know how to get it, as it's an array, to do an ActionListener. I tried the obvious Object[[ items = new Object[4];

    items[0].addActionListener()....

    but it didn't like it, so I got rid of the JComboBox, though I'd like to know how to work it, but my brain is fried right now from my stupid VCR destroying my video and trying to fix it, and most likely just making it worse, and trying a lot of the day to get the JScrollBar to work and go on the JFrame so I can scroll down if I have too many buttons, or the JTextArea is too huge, as it is a bit smallish right now and I want to make it 40,40, but I need to have scroll bars on the JFrame or else all of the buttons won't fit. The scroll bars are there, not where I want them, about 3/4 of an inch long/tall. Not quite what I wanted.

    Last edited by javapenguin; June 25th, 2010 at 09:08 PM. Reason: Is this what you meant by missing code?

  10. #8
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Evil JScrollBars

    Still not following enough to answer your first question directly (obviously because I assumed a JComboBox would solve your problem). One suggestion would be to simplify the problem....reduce your layout/problem/whatever...into a simple program that reproduces what you see in some way (this helps both us and you). In my opinion GUI's are easier to build from the bottom up rather than top down.

  11. #9
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Evil JScrollBars

    reduce your layout/problem/whatever...into a SMALL simple program that reproduces what you see in some way (this helps both us and you).
    This is how you can get some one to help.
    Last edited by Norm; June 26th, 2010 at 09:12 AM.

  12. #10
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Evil JScrollBars

    Quote Originally Posted by copeg View Post
    Still not following enough to answer your first question directly (obviously because I assumed a JComboBox would solve your problem). One suggestion would be to simplify the problem....reduce your layout/problem/whatever...into a simple program that reproduces what you see in some way (this helps both us and you). In my opinion GUI's are easier to build from the bottom up rather than top down.
    How do I do listeners for the JComboBox like I would for the chapter? That would allow me to make the JTextArea quite a bit wider and longer. However, I still would prefer two scrollbars so I can make it maybe 45 by 45 or larger instead of 25 by 25.

    I just got an idea though for something from something I found on Google. Maybe if I set layout to null it will work and not have a "superlarge" button.


  13. #11
    Member Darryl.Burke's Avatar
    Join Date
    Mar 2010
    Location
    Madgaon, Goa, India
    Posts
    494
    Thanks
    8
    Thanked 48 Times in 46 Posts

    Default Re: Evil JScrollBars

    Quote Originally Posted by javapenguin View Post
    How do I do listeners for the JComboBo
    Read the API for JComboBox and follow the link to the tutorial on How to Use Combo Boxes where you will find a working example.

    Quote Originally Posted by javapenguin View Post
    Maybe if I set layout to null
    Bad idea. When you're done reading the combo box tutorial, fish around till you find the tutorial on Laying out Components in a Container. Find the layout that suits your requirement. It probably won't be BorderLayout.

    db

  14. The Following User Says Thank You to Darryl.Burke For This Useful Post:

    javapenguin (June 26th, 2010)

  15. #12
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Evil JScrollBars

    Ok, setting the layout will get one of the scroll bars to appear, but I can't get anything else to come up, and the scroll bar still isn't big enough. It is of no value unless I can use it so I can have more on a JPanel than I could without one.

    Hmmmm....is it possible to add a JScrollPane to a JFrame itself and not just to a text area within that JFrame/JPanel?

  16. #13
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Evil JScrollBars

    Here is a picture of what it is doing.
    Attached Images Attached Images

  17. #14
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Evil JScrollBars

    How do I do listeners for the JComboBox
    Read the API doc for that class and see.

  18. The Following User Says Thank You to Norm For This Useful Post:

    javapenguin (June 26th, 2010)

  19. #15
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Evil JScrollBars

    Ok, I will, but what about the scroll bar? It's too small.

  20. #16
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Evil JScrollBars

    Quote Originally Posted by Norm View Post
    Read the API doc for that class and see.
    When using a JComboBox, do I use an ItmeListener or an ActionListener for each thing in the JComboBox? The site has a constructor like this JComboBox(Object[] items );

    That's why I'm wondering if perhaps I should use an item listener.

    However, I still would like to know how to add JScrollBars.

    See how the thing that lets you write these comments has both a scroll bar in the text field and one that comes to scroll down the whole page. How do you get the one that scrolls down the whole page? And no, I don't want an applet....I just am trying to make a window vs. just a text area that can scroll down.

  21. #17
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Evil JScrollBars

    I already have the stuff defined in the constructor like it should be.
    [CODE][panel3 = new JPanel();
    bar = new JScrollBar(JScrollBar.VERTICAL, 30, 20, 0, 300);
    panel3.add(bar, BorderLayout.WEST);
    bar.setVisible(true);
    // panel3.add(bar);
    bar.setBlockIncrement(1);
    bar.setUnitIncrement(2);
    bar.setSize(20, 400);
    bar.setLocation(0,0);

    System.out.println(bar.getLocation());
    bar2 = new JScrollBar(java.awt.Adjustable.HORIZONTAL, 30, 40, 0, 300);
    // panel3.add(bar2);
    bar2.setBlockIncrement(1);
    bar2.setUnitIncrement(2);
    bar.setBounds(20, 20, 20, 200);
    bar.setVisible(true);
    panel3.add(bar);
    panel3.add(bar2);
    bar.setEnabled(true);
    bar2.setEnabled(true);
    bar.setSize(200, 200);
    bar2.setSize(30, 100);
    bar2.setLocation(0, 5);
    int x = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
    int y = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED ;
    textArea2 = new JTextArea(25, 25);
    textArea2.setEditable(false);
    scroll2 = new JScrollPane(textArea2, x, y);
    scroll2.setVisible(true);
    panel3.add(scroll2);
    panel3.setBounds(20, 20, 20, 200);
    bar.setLayout(new GridLayout());
    bar2.setLayout(new BorderLayout());
    //panel3.setLayout(new BorderLayout(100, 100));
    panel3.add(bar, BorderLayout.EAST);
    bar.setVisible(true);
    bar.setSize(200, 20);
    panel3.setVisible(true);/CODE]

  22. #18
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Evil JScrollBars

    Read post#2

  23. #19
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Evil JScrollBars

    label = new JLabel("Label");
    		label2  = new JLabel("Label");
    		panel3 = new JPanel();
    		bar = new JScrollBar(JScrollBar.VERTICAL, 30, 20, 0, 1000000);
    		panel3.add(bar, BorderLayout.WEST);
    		bar.setVisible(true);
    		// panel3.add(bar);
    		bar.setBlockIncrement(1);
    		bar.setUnitIncrement(2);
    		bar.setSize(20, 400);
    		bar.setLocation(0,0);
            System.out.println(bar.getLocation());
    		bar2 = new JScrollBar(JScrollBar.HORIZONTAL, 0, 40, 0, 1000000000);
    		// panel3.add(bar2);
    		bar2.setBlockIncrement(1);
    		bar2.setUnitIncrement(2);
    		bar.setBounds(20, 20, 20, 300);
    		bar.setVisible(true);
    		panel3.add(bar);
    		panel3.add(label2);
    		 panel3.add(bar2);
    		bar.setEnabled(true);
    		bar2.setEnabled(true);
    		bar.setSize(200, 200);
            bar2.setSize(30, 100);
            bar2.setLocation(0, 5);
            System.out.println(bar.getValue());
    		int x = ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
    		int y = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
    		textArea2 = new JTextArea(25, 25);
    		textArea2.setEditable(false);
    		scroll2 = new JScrollPane(textArea2, x, y);
    		scroll3 = new JScrollPane(null, x, y);
    		scroll2.setVisible(true);
    		panel3.add(scroll2);
    	    scroll3.setVisible(true);
    	    panel3.add(scroll3);
    		panel3.add(label);
            panel3.setBounds(20, 20, 20, 200);
            // bar.setLayout(new GridLayout());
            // bar2.setLayout(new BorderLayout());
    		//panel3.setLayout(new BorderLayout(100, 100));
            panel3.add(bar, BorderLayout.EAST);
          bar.setVisible(true);
    		bar.setSize(200, 30);
    		panel3.setVisible(true);
    		System.out.println(panel3.getLayout());
     
           bar.addAdjustmentListener(
        		   new AdjustmentListener()
        		   {
        			   public void adjustmentValueChanged(AdjustmentEvent e)
        			   {
        				   label.setText("    New Value is " + e.getValue() + "      ");
        				      repaint();
     
        			   }
        		   });
     
           bar2.addAdjustmentListener(
        		   new AdjustmentListener()
        		   {
        			   public void adjustmentValueChanged(AdjustmentEvent e)
        			   {
        				   label2.setText("    New Value is " + e.getValue() + "      ");
        				      repaint();
        			   }
        		   });

    this is the smallest I can get. It needs to go into the larger program, otherwise I could extend JFrame. I want my scroll bars to work like JScrollPanes, but they don't actually scroll down or left or right or up the JPanel.

  24. #20
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Evil JScrollBars

    This is useless. It needs to be a complete program that compiles and executes.

  25. #21
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Lightbulb Re: Evil JScrollBars

    If you want a complete program, it'll have to be the long one, but only focus on ExoWindow.
    That one will compile, though I already had an image that showed what ExoWindow did posted earlier.
    Last edited by javapenguin; June 26th, 2010 at 06:27 PM. Reason: I felt like it

  26. #22
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Evil JScrollBars

    Definitely do NOT want the complete program.

  27. #23
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Evil JScrollBars

    I still don't know how to get the JPanel itself to scroll down, but I did, but doing something with JScrollBar, make it able, when a certain scrollbar is moved, to be able to resize the JFrame! I noticed one that didn't have scrollbars couldn't resize like that, so my efforts are totally useless. Perhaps a mysterious thing called a JInternalFrame might make the need for a scrollbar unneceesary. However, I can't get it to stay open or do anything much. Do I need a JDesktopPane first?

  28. #24
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Evil JScrollBars

    See post#2

  29. The Following User Says Thank You to Norm For This Useful Post:

    javapenguin (June 26th, 2010)

  30. #25
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Cool Re: Evil JScrollBars

    Oh, so JDesktopPane, which I still don't know exactly what it is, is used to hold multiple JInternalPanes that might overlap each other.

Page 1 of 2 12 LastLast