Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Browser making by java coding

Have Programming Question? Ask it here!
 
 
 


raj
Browser making by java coding
0 Answer(s)      3 years and 5 months ago
Posted in : Java Beginners


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#;
}}

Advertisement
View Answers

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
making trees - Java Beginners
making trees   pls i do't know what this yerms mean in terms of java trees and stacks? Inorder traverse Switch statement Doing something to the stack thanks in advance
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
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
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
Making efficient program - Java Beginners
Making efficient program  Hi, How you can write efficient programs in Java? Thanks
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  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  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  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
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 - WebSevices
Java coding for web services  How to start Java Coding for web services
browser
browser  how to add menu items in the menu in java swing through java coding
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 - Java Beginners
java coding  dear sir, i'm doing a java coding using with netbeans ide, so i'm trying to pass some text from one jframe to another jframe which is both are already opend on screen then how to do it? please send me
Toolbar to a browser - Java Beginners
to display toolbar on the browser? Thanks  I want to create a website's... browser, some site ask us to download the application and install it. so i wanted
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
coding - Java Beginners
coding  i need to start coding but i don't know how to start it so plz help me  Hi Friend, Please visit the following link: http://www.roseindia.net/java/ Thanks
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
Coding - Java Beginners
Coding  How to do a coding to view employee name, salary and EPF. The EPF is calculated from the salary like 10% from their salary. and it also show... the technologies you create the application in Java/JSP/Servlet/JSF/Struts
coding - Java Beginners
coding  i need start coding but don't have any idea to start plz help me
java coding - Java Beginners
java coding  how to create a window that contain a list of all files of specified directory
browser
browser  how to make a browser
coding related - Java Beginners
coding related  what is the purpose of using these line in a program? char units = args[1].charAt(0); units = Character.toUpperCase.../java/java-conversion
Java Coding - Java Beginners
Java Coding  Code a for loop that adds the integers that are multiples of 5 starting with 50 and ending with 5. Each time the sum is increased, print it on a line at the console. Be sure to declare and initialize any required
Java Coding - Java Beginners
Java Coding  What is the meaning of following statement in Java? Clasname objectname = another_object_name.method_name; The Example Code is Given Below public void sessionCreated(HttpSessionEvent sessionEvent
Java Coding - Java Beginners
Java Coding  How do I code the following: Code a while loop that calculates the sum of the integers that are multiples of 5 starting with 5... on Java visit to : http://www.roseindia.net/java/ Thanks
Java Coding - Java Beginners
Java Coding  Code a private static method named printMessage that accepts a String parameter that represents the message. The method should simply print the message followed by a blank line at the console. Write a statement
Java Coding - Java Beginners
Java Coding  Code nested for loops that calculate the area of a rectangle that can range in size from a length and width of 1 to a length and width of 10. Print the area for each width for a given length on a single line
coding problem - Java Beginners
coding problem  hi friend! Im new to jasper reports.how can i start that coding inorder to generate reports.can u send some sample programs for reporting?im badly need some clearly mentioned example because im new to jasper
Java Coding - Java Beginners
Java Coding  Two overloading methods that returns average using following headers A) public static int average(int[] array) B) public static double average(double[] array The program should prompt the user to enter
j2me coding - Java Magazine
in sms using j2me. i have a problem in coding for sending and receiving sms .i have a coding for receiving sms but it not work because that program need sending... a coding for sending and receiving sms in j2me
Java Coding - Java Beginners
Java Coding  How do I code the following: Code a switch statement that tests the value of an int variable named weightInt. This variable contains the weight of a shipment rounded up to the nearest multiple of 5. If the value
Java Coding - Java Beginners
Java Coding  Write a program containing two functions, bubbleSort( ) and mergeSort( ). Each function should take an array of integers, sort the array using the appropriate algorithm and then return the sorted array
JAVA Coding - Java Beginners
JAVA Coding  Have to write a function that will write out from 1..., q ; if ( number < 10 ){ show ( st1[number] ) ; } if ( number > 9... = number % 10 ; if ( word == 0 ){ q = number / 10 ; show ( st4[q-2] ) ; } else
Java Coding - Java Beginners
Java Coding  How do I code the following: Code a private static method named getUPSShipping that accepts a double value named weight and an integer named zipCode and returns a double value. This method should set the value
JAVA Coding - Java Beginners
JAVA Coding  Have to write a function that will write out from 1... word, q ; if ( number < 10 ){ show ( st1[number] ) ; } if ( number > 9... ){ word = number % 10 ; if ( word == 0 ){ q = number / 10 ; show ( st4[q-2
Java Coding - Java Beginners
Java Coding  How do I code the following? Code an if/else statement that tests the value of a string variable named shippingMethod to determine if it has a value of ?UPS,? ?FEDEX,? or another value. If the value is ?UPS,? call
Java Coding - Java Beginners
Java Coding  How do I do the following: Code an if/else statement that tests the value of a string variable named shippingMethod to determine if it has a value of ?UPS,? ?FEDEX,? or another value. If the value is ?UPS,? code
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
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
coding problem - Java Beginners
coding problem  hi! i declared date as date datatype in oracle now i need to retrieve date from database to my java code.how can i please help me urgent   Hi Friend, We are providing you a code that will retrieve
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
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
Advertisements
 

 

 

DMCA.com