Browser making by java coding

Browser making by java coding

import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
public class Browser extends JFrame implements HyperlinkListener,ActionListener
{
 public static void main(String args[])
{
 if(args.length==0)
new Browser ("http:google.com"#;

else
 new Browser#args#0##;
}
// private JIconButton homeButton;
private JTextField urlField;
private JEditorPane htmlPane;
private String initialURL;
public Browser#String initialURL#
{
super#"RajKaBrowser"#;
this#initialURL=initialURL;
WindowUtilities#setNativeLookAndFeel##;
add WindowListener#new ExitListener###;

JPanel topPanel=new JPanel##;
topPanel#setBackground#Color#lightGray#;
JLabel urlLabel=new JLabel#"URL"#;
urlField=new JTextField#30#;
urlField#setText#initialURL#;
urlField#addActionListener#this#;
topPanel#add#urlLabel#;
topPanel#add#urlField#;
getContentPane###add#topPanel,BorderLayout#NORTH#;
try{
htmlPane=new JEditorPane#initialURL#;
htmlPane#setEditable#false#;
htmlPane#addHyperlinkListener#this#;
JScrollPane scrollPane=new JScrollPane#htmlPane#;
getContentPane###add#scrollPane,BorderLayout#CENTER#;
}
catch#IOException ioe#
{
 warnuser#"can't build HTML pane for"+initialURL+":"+ioe#;
}
Toolkit t=getToolkit##;
Dimension screenSize=t#getScreenSize##;
int width=screenSize#width*8/10;
int height=screenSize#height*8/10;
setBounds#width/8,height/8,width,height#;
 setVisible#true#;
}
 public void actionPerformed

//ActionEvent event

{
 String url;
 if#event#getSource##==urlField#
 url=urlField#getText##;
else//Clicked "Home" button instead //of entering URL
url=initialURL;
try
{
 htmlPane#setPage#new URL#url##;
urlField#setText#url#;
}
 catch#IOException ioe#
{
 warnuser#"Can't follow link to"+url+":"+ioe#;
}}
public void hyperlinkUpdate#HyperlinkEvent event#
{
 if#event#getEventType##==HyperlinkEvent.EventType.ACTIVATED#
{
 try
{
  htmlPane.setPage#event.getURL###;
urlField.setText#event.getURL##.toExternalForm###;
}
 catch#IOException ioe#
{
 warnuser#"can't follow link to"+event.getURL##.toExternalForm##+":"+ioe#;
}}}
 private void warnuser#String message#
{
  JOptionPane.showMessageDialog#this,message,"Error",JOptionPane.ERROR_MESSAGE#;
}}
View Answers

Ads









Related Tutorials/Questions & Answers:
Browser making by java coding
Browser making by java coding  import javax.swing.*; import...*; import java.io.*; public class Browser extends JFrame implements...[]) { if(args.length==0) new Browser ("http:google.com"#; else new Browser#args#0
Java Coding
Java Coding  Hello, Can u please tel me how to improve my coding techniques.I am feeling difficulty with coding but I am perfect with my theory part
Advertisements
Java making a method deprecated
Java making a method deprecated  java making a method deprecated In Java how to declare a method depricated? Is it correct to use depricated... Java application. Though, it is not a correct way to use a deprecated class
making use java image filters
making use java image filters  while making use any functions built in jerry's filter in java application i get a NullPointerException.. I dont know the reason for this.. please give me a solution
coding in java
coding in java  write a code to calculate the product of odd integers from 1-15   class ProductOfOddIntegers { public static void main(String[] args) { long product=1; for(int i=1;i<=15;i
java coding
java coding  Hi sir, WRITE A PROGRAMME TO MAKE EMPLOYMENT MANAGMENT HAVING COLORS AND FRAME IN IT,???? CAN U SUGGEST ME HOW TO MAKE IT IN CORE JAVA
java coding
java coding  sir i need code for how to send meg from one system to another system
java coding
java coding  i need to to a project in java and the title is file parsing. i need to read a file or if a particular file is given i have to count the no of vowels, pick out some terms, and to display the details about that file
java coding
java coding  i am using netbean to my project and it is Desktop Application.i want my textfield to accept only numbers or only alphabets .........plez plez plez do help me..........i am just beginner to java codes
java coding
java coding  Hai,I am having order table in mysql database.when user click download button the order table data shows in csv format.Its very urgent.please help me. Thanks in advance
java coding
java coding  i have source code for my project virtual classroom. i need a little guidance to run that code..do help me out
java coding
java coding  using swing i want to give an exit button which on clicking ask a msg "JOptionPane" is select "yes" then it should exit or else not....plez help me...... JOptionPane.showConfirmDialog(null,"DO YOU REALLY WANT
JAVA coding
JAVA coding  using classes and arrays implement the following create classes, inheritance, object and execute methods. there are 5 students in a class, capture the surname, first name, age and sex. capture their marks of a given
java coding
java coding  plz correct this one ....i want to retrive data row from databse ...all its working but for combobox it not.......plz plz plz help me...... private void jButton4ActionPerformed(java.awt.event.ActionEvent evt
java coding
java coding  (person, student,employee, faculty and staff are classes) design a class named person and its two subclasses named student and employee    class Person { public String name; public String address; public
java coding
java coding  can any one plez tell me how to retrive a row from access to each field of swing... i hav tried this but i am getting an SQL error "SQLExceptionOccurred[Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect
browser
browser  how to add menu items in the menu in java swing through java coding
Image using Java coding
Image using Java coding  Hai, Display image in pdf file using Java coding through Xsl file.. Please help me.. xsl file generate the pdf file
color coding in java
color coding in java  hii..can anyone please help with auto coloring code in java swings..??a particular text field should have a particular color for a particular event..plzz help
single frame coding in java
single frame coding in java  sir, i am a beginner in java.i want to do a desktop application in java in which a single frame satisfies all needs.but i want changes in that frame only.how can i solve this?i think multiple frames
browser
browser  how to make a browser
Embed Default Browser within Java Application
Embed Default Browser within Java Application  After some googling i... making IE my default browser but that didnt work Please help... to embed browser with or without using Netbeans I ve already tried this 2
Java Web Browser Problem
Java Web Browser Problem  Hello When run my web browser this is not displaying complete page any of the website like other browser.So Plz help me...."); setTitle("NextVision Browser"); setSize(600,400); Container
java coding for creating table in the console
java coding for creating table in the console  write a java program to create table
browser
in the swing because I am working on my project Browser and one more problem is that when I entered the URL then some page open which made in java and the page
Plz give java coding for this
Plz give java coding for this   ****** * * * *********** * * * ******   Hello Friend; below is the code : public class Pattern { public static void main(String[] args) { int
java coding help plz ?
java coding help plz ?  Given two integers N and M (N ââ?°Â¤ M), output all the prime numbers between N and M inclusive, one per line. N and M will be positive integers less than or equal to 1,000,000,000. The difference
coding
coding  I need the logout coding. can you please help me.   Please visit the following links: http://www.roseindia.net/quickguide/tomcat/Logout.shtml http://www.roseindia.net/jsp/loginstatus.shtml
how to get browser cookies in java
how to get browser cookies in java  Hi, How to get cookies in serverlet and then print? how to get browser cookies in java? Thanks   Hi, Use following code: Cookie[] cookies = request.getCookies(); for (int i = 0
Decision-making Statements in java 7
Decision-making Statements in java 7 In this section, we will discuss about Decision-making Statements in java 7. This is one type of control flow statement. Decision-making Statements : This kind of control statements is used where
coding
coding  Write a java program to Create table - Employee containing empId String (20), empName String (50), DOB Date, deptId String(20). Primary key is empId. Foreign Key is deptId. Populate some records
j2me sms coding - Java Beginners
j2me sms coding  please send me the source code to send sms and making a call from mobile
opening new browser with new JSESSIONID using java
opening new browser with new JSESSIONID using java  I am facing following problem, I am trying to open a new browser using java. First i have opened one IE browser and manually. And i ran my LaunchURL.java file, it is opening new
Opening a browser only with body from a java program
Opening a browser only with body from a java program  Hi all, I got following requirement, Opening a browser window only with body and title bar. And based on some condition, after some time, i have to close the browser window
DECESION MAKING STATEMENTS
DECESION MAKING STATEMENTS  The Decision Making statements may be implemented in different forms depending on the complexity of the condition to be tested. Describe various forms of decision making statements in java
Making Exceptions Unchecked - java tutorial,java tutorials
and Unchecked Exceptions in java and how to handle it. The Exception is a condition which indicates error in your code. Types of built-in exception in Java Given below types of built-in exception in java : 1. Unchecked Exception 2. Checked
hi... pls give me the example of java coding fo following question
hi... pls give me the example of java coding fo following question  example java coding that reads in the radius and length of cylinder and computes volume. formula: Area = radius * radius * PI Volume = area * length
who know full coding of guessing game in java?
who know full coding of guessing game in java?  There is only 1 player. Use JAVA Random toolkit to generate random number between 1 to 10. Once user has entered in a number, checked whether the number match with the generated
Java coding for beginners
very beginning. Tutorial Java coding for beginners will enable you to know about the Java Coding and its various aspects during programming. It also introduces you with the Java Programming language and coding. In this topic, students
MAking combinitions
MAking combinitions  Dear All, Please help me.... I have some 60-70 lineswhich contains \new\code\R2.0.1\option.c \new\code\R2.0.3\option.c \new\code\R2.0.1\Test.c \new\code\R2.0.2\Test.c \new\code\R2.0.3\Test.c \new\code
making help window
making help window   how to make help window in gui with java
coding for chart
coding for chart  I want to convert a character into binary then convert it into its diagram in form of digital electrical signals.How can I do java coding for this diagram
Pattern Making
Pattern Making  how to print this pattern in java? * * * * * * * * * * * * * * * * * It is just an example
Java Code to Block a website accessed by any browser in windows
Java Code to Block a website accessed by any browser in windows  I want create an application in Java through Netbean IDE to block any website to be accessed by any browser. I also want to display only its html contents. please
Java Coding Standards
Java Coding Standards       Coding conventions are the rules that a programmer should govern while develop a program so that their source code can be read and maintain easily. Coding
Help needed on java standalone app and default browser interaction.
Help needed on java standalone app and default browser interaction.  ... the url thats displaying on my default browser to my java standalone application? Platform Windows Browser IE7 Any from of help would be deeply apperciated
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a program that displays the following table (note that 1 mile is 1.609 kilometers). Miles Kilometers
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a program that prompts the user to enter the number of students and each studentâ??s name and score, and finally displays the name of the students
Java code to executr db query if user directly closes the browser
Java code to executr db query if user directly closes the browser  How to execute a database query if the logged in user idle for 15 mins or he will directly close the browser.........PLS help it out
Browser Back Button Disable/Hide/Invisible using Java Script
Browser Back Button Disable/Hide/Invisible using Java Script  Dear Sir, Please Help..., Q: How to Write Code For Browser Back Button Disable/Hide/Invisible using Java Script without Page Reload/Refreshing. anyone

Ads