Register FAQ Calendar Search Today's Posts Mark Forums Read

Go Back   Java Programming Forums > Java Programming > Advanced Java

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-07-2008, 02:41 PM
Junior Member
 
Join Date: Jul 2008
Posts: 2
don.java1 is on a distinguished road
Default I need to know how to link pages

AM TRYING TO HYPER-LINK PAGES TOGETHER IN JAVA BUT I DONT KNOW HOW TO DO IT.IF I CLICK A BUTTON,I WANT IT TO GO TO THE NEXT PAGE.THIS IS THE CODE AM TRYING TO HYPER-LINK TO ANOTHER PAGE.

PAGE1
Java Code:
import java.applet.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
 
 
/*<applet code="Application.class" height="600" width="550">
</applet>
*/
public class Application extends Applet implements ActionListener
{
        Label lheading = new Label("Application Form", Label.CENTER);
        Label lheading2 = new Label("Applying For");
        Label lgrad = new Label("Graduation Degree Program*");
        TextField tgrad = new TextField(10);
        Label lskul = new Label("School*");
        TextField tskul = new TextField(15);
        Label lheading3 = new Label("Personal Details");
        Label lname = new Label("Name*");
        TextField tname = new TextField(10);
        Label lmiddle = new Label("Middle*");
        TextField tmiddle = new TextField(10);
        Label llast = new Label("Last*");
        TextField tlast = new TextField(10);
        Label laddress = new Label("Address*");
        TextField taddress = new TextField(15);
        Label lcity = new Label("City*");
        TextField tcity = new TextField(7);
        Label lstate = new Label("State*");
        TextField tstate = new TextField(7);
        Label lZipcode = new Label("Zipcode*");
        TextField tzipcode = new TextField(5);
        Label lcountry = new Label("Country*");
        TextField tcountry = new TextField(10);
        Label lphone = new Label("Phone(Residence)*");
        TextField tphone = new TextField(9);    
        Label lcountrycode = new Label("Country Code*");
        TextField tcountrycode = new TextField(5);
        Label lareacode1 = new Label("Area Code*");
        TextField tareacode1 = new TextField(5);
        Label lphoneno1 = new Label("Phone Number*");
        TextField tphoneno1 = new TextField(9);
        Label lphone2 = new Label("Phone(Office)*");
        TextField tphone2 = new TextField(9);
        Label lcountrycode1 = new Label("Country Code*");
        TextField tcountrycode1 = new TextField(5);
        Label lareacode2 = new Label("Area Code*");
        TextField tareacode2 = new TextField(5);
        Label lphoneno2 = new Label("Phone Number*");
        TextField tphoneno2 = new TextField(9);
        Label lmail = new Label("E-mail Address*");
        TextField tmail = new TextField(15);
        Label lgender = new Label("Gender");
        Choice gender = new Choice();
        Label ldate = new Label("Date*");
        Choice mdate = new Choice();
        Choice ddate = new Choice();
        Choice ydate = new Choice();
        Label lstatus = new Label("Citizenship Status*");
        Choice cstatus = new Choice();
        Button cont = new Button("Continue");
 
public void init()
    {
        ApplicationForm();
    }
public void ApplicationForm()
 
        {
        setLayout(new FlowLayout(20,5,5));
        add(lheading);
        add(lheading2);
        add(lgrad);
        add(tgrad);
        add(lskul);
        add(tskul);
        add(lheading3);
        add(lname);
        add(tname);
        add(lmiddle);
        add(tmiddle);
        add(llast);
        add(tlast);
        add(laddress);
        add(taddress);
        add(lcity);
        add(tcity);
        add(lstate);
        add(tstate);
        add(lZipcode);
        add(lcountry);
        add(tcountry);    
        add(lphone);
        add(tphone);
        add(lcountrycode);
        add(tcountrycode);
        add(lareacode1);
        add(tareacode1);
        add(lphoneno1);
        add(tphoneno1);
        add(lphone2);
        add(tphone2);
        add(lcountrycode1);
        add(tcountrycode1);
        add(lareacode2);
        add(tareacode2);
        add(lphoneno2);
        add(tphoneno2);
        add(lmail);
        add(tmail);
        add(lgender);
        gender.add("Male");
        gender.add("Female");
        add(gender);
        add(ldate);
        mdate.add("Jan");
        mdate.add("Feb");
        mdate.add("Mar");
        mdate.add("Apr");
        mdate.add("May");
        mdate.add("Jun");
        mdate.add("Jul");
        mdate.add("Aug");
        mdate.add("Sep");
        mdate.add("Oct");
        mdate.add("Nov");
        mdate.add("Dec");
        add(mdate);
        ddate.add("1");
        ddate.add("2");
        ddate.add("3");
        ddate.add("4");
        ddate.add("5");
        ddate.add("6");
        ddate.add("8");
        ddate.add("9");
        ddate.add("10");
        ddate.add("11");
        ddate.add("12");
        ddate.add("13");
        ddate.add("14");
        ddate.add("15");
        ddate.add("16");
 
        add(ddate);
        ydate.add("90");
        ydate.add("89");
        ydate.add("88");
        ydate.add("87");
        ydate.add("86");
        ydate.add("85");
        ydate.add("84");
        ydate.add("83");
        ydate.add("82");
        ydate.add("81");
        ydate.add("80");
        ydate.add("79");
        ydate.add("78");
        ydate.add("77");
        ydate.add("76");
        ydate.add("75");
        add(ydate);
        add(lstatus);
        cstatus.add("U.S Citizen");
 
        cstatus.add("U.S Permanent Resident");
        cstatus.add("Not a U.S");
        cstatus.add("Decline to State");
        add(cstatus);
        add(cont);
        cont.addActionListener(this);
 
        }
 
 
public void actionPerformed(ActionEvent ae1)
    {
        Object o1 = ae1.getSource();
        if(o1 == cont)
    {
            if((tname.getText().equals("")) || 
            (tmiddle.getText().equals(""))||
            (tlast.getText().equals(""))||
            (taddress.getText().equals(""))||
            (tphone.getText().equals(""))||
            (tmail.getText().equals(""))||
            (mdate.getName().equals("jan")))
            JOptionPane.showMessageDialog(null,"The Asteric Field Must Not Be Blank");
            String s = "Graduation Degree program>" + tgrad.getText() +
            "School>" + tskul.getText() + 
            "FirstName>" + tname.getText() + 
            "MiddleName>" + tmiddle.getText() + 
            "LastName>" + tlast.getText()+ 
            "Address>" + taddress.getText() + 
            "City>" + tcity.getText() + 
            "State>" + tstate.getText() + 
            "Zipcode>" + tzipcode.getText()+ 
            "Country>" + tcountry.getText()+ 
            "Phone(Residence)>" + tphone.getText()+ 
            "Country Code>" + tcountrycode.getText()+ 
            "Area Code" + tareacode1.getText()+ 
            "Phone Number>" + tphoneno1.getText()+ 
            "Phone(Office)>" + tphone2.getText()+ 
            "Country Code>" + tcountrycode1.getText()+ 
            "Area Code>" + tareacode2.getText()+ 
            "Phone Number>" + tphoneno2.getText()+ 
            "E-Mail Address" + tmail.getText()+ 
            "Gender>" + gender.getName()+ 
            "Date Of Birth>" + mdate.getName()+
            "/" + ddate.getName()+"/"+ ydate.getName()+ 
            "Citizenship Status>" + cstatus.getName();
 
 
        try
        {
            RandomAccessFile lFile = new RandomAccessFile("C:/Users/Dotun/Documents/application.txt","rw");
            lFile.seek(lFile.length());
            lFile.writeBytes(s);
        }
        catch(IOException ie)
        {
            showStatus("Unable to Calculate due to invalid value input" + ie);
 
        }
    }
 
 
}
}
THIS IS THE PAGE YOU WILL HYPER-LINK THE ABOVE CODE TOO.
PAGE2
Java Code:
import java.applet.*;
import java.awt.*;
 
 
/*<applet code="Welcome.class" height="600" width="550">
</applet>
*/
public class Welcome extends Applet
{
    public void init()
    {
        Label lheading = new Label("WELCOME TO THE SCHOOL", Label.CENTER);
        add(lheading);    
}
}
Reply With Quote
  #2 (permalink)  
Old 11-07-2008, 06:37 PM
Member
 
Join Date: May 2008
Posts: 58
Engineeringserver.com is on a distinguished road
Default Re: I need to know how to link pages

You can use the URL class to do this. Or as an alternative, include my AdsPanel in your project and you can create hyperlinks or images with hyperlinks. Demo + code: Clickable banners in your application
Reply With Quote
  #3 (permalink)  
Old 18-07-2008, 06:15 PM
Junior Member
 
Join Date: Jul 2008
Posts: 2
don.java1 is on a distinguished road
Default Re: I need to know how to link pages

i was hoping maybe you could be my teacher.i like to be ahead of my peers and i my goal is to graduate as the best student in my school.WOULD LIKE TO BE MY TEACHER
Reply With Quote
  #4 (permalink)  
Old 20-07-2008, 05:52 PM
JavaPF's Avatar
Java Programmer
 
Join Date: May 2008
Location: Deep inside the Eclipse IDE
Posts: 172
JavaPF will become famous soon enoughJavaPF will become famous soon enough
Default Re: I need to know how to link pages

Quote:
Originally Posted by don.java1 View Post
i was hoping maybe you could be my teacher.i like to be ahead of my peers and i my goal is to graduate as the best student in my school.WOULD LIKE TO BE MY TEACHER
I cant imagine ES or anyone else here having the time to be your teacher!
Your best bet is to read as many online Java tutorials and books as you can. Follow all the examples and try to write your own programs using what you have learnt.

With some dedication you'll be ahead of your peers no problem.

If you are having problems then feel free to post here because we will do our best to help you improve. We all started somewhere...

Sams teach yourself Java in 21 days

Reply With Quote
  #5 (permalink)  
Old 20-07-2008, 06:14 PM
Member
 
Join Date: May 2008
Posts: 58
Engineeringserver.com is on a distinguished road
Default Re: I need to know how to link pages

Well, money talks =)
Reply With Quote
  #6 (permalink)  
Old 21-07-2008, 10:09 AM
JavaPF's Avatar
Java Programmer
 
Join Date: May 2008
Location: Deep inside the Eclipse IDE
Posts: 172
JavaPF will become famous soon enoughJavaPF will become famous soon enough
Default Re: I need to know how to link pages

Quote:
Originally Posted by Engineeringserver.com View Post
Well, money talks =)
haha fair enough!!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Custom Search
100 most searched terms
Search Cloud
"bad endpoint type" com.sun.xml.internal.messaging.saaj.soapexceptionimpl com.sun.xml.internal.messaging.saaj.soapexceptionimpl: bad endpoint type com.sun.xml.internal.messaging.saaj.soapexceptionimpl: java.security.privilegedactionexception com.sun.xml.internal.messaging.saaj.soapexceptionimpl: java.security.privilegedactionexception: com.sun.xml.internal.messaging.saaj.soapexceptionimpl: java.security.privilegedactionexception: com.sun.xml.internal.messaging.saaj.soapexceptionimpl: message send failed com.sun.xml.internal.messaging.saaj.soapexceptionimpl: message send failed com.sun.xml.messaging.saaj.soapexceptionimpl: java.security.privilegedactionexception com.sun.xml.messaging.saaj.soapexceptionimpl: java.security.privilegedactionexception: com.sun.xml.messaging.saaj.soapexceptionimpl: message send failed convert arraylist to map date_format_now eclipse shortcut keys ejb3 quartz java convert double to binary java forum java forums java jtextarea bold java jtextarea color java jtextarea font java jtextarea font size java programmer forum java programmers forum java programming forum java programming forums java read last line java read last line of file java sendkeys java.security.privilegedactionexception java.security.privilegedactionexception: com.sun.xml.internal.messaging.saaj.soapexceptionimpl java.security.privilegedactionexception: com.sun.xml.internal.messaging.saaj.soapexceptionimpl: bad response java.security.privilegedactionexception: com.sun.xml.internal.messaging.saaj.soapexceptionimpl: message send failed java.security.privilegedactionexception: com.sun.xml.messaging.saaj.soapexceptionimpl: message send failed javapf javaprogrammingforums jtextarea bold jtextarea font jtextarea font color jtextarea font size programing forums programming forums reset jcombobox saaj0008 saaj0008: bad response; bad request saaj0008: bad response; not found severe: saaj0008 severe: saaj0008: bad response; bad request severe: saaj0008: bad response; not found soap java.security.privilegedactionexception soapexceptionimpl: bad endpoint type textpad java

All times are GMT. The time now is 12:06 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.