Total members 11343 |It is currently Thu Jul 24, 2014 10:40 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

All times are UTC [ DST ]



  Java Web Browser (Mini Project)
Thu Oct 16, 2008 6:02 pm 

* Project Name:   Java Web Browser
* Programmer:   can ökçelik
* Type:   Network
* Technology:  Java
* IDE:   ANY
* Description:   it's very basic application.you can only calling a page and click links with it.i hoop, i will develop better more sooner..enjoy with it!!

Code:


import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import javax.swing.*;
import javax.swing.event.*;


public class Tarayici extends JFrame implements
ActionListener,HyperlinkListener
{
   private JEditorPane webs;
   private JScrollPane kay;
   private JMenuBar menubar;
   private JMenu menu,hakkimda;
   private JMenuItem menukapa;
   private Button kapat;
   private Button yazdir;
   private Button dugme;
   private TextField kutu;
   private URL url;

   public Tarayici()
   {

      super("Tarayici");
      setSize(950,700);

      Container c=getContentPane();

      dugme=new Button("Git");
      dugme.addActionListener(this);

      menubar=new JMenuBar();
      menu=new JMenu("Dosya");
      hakkimda=new JMenu("Hakkýmda");
      hakkimda.addActionListener(this);
      menukapa=new JMenuItem("Çýkýþ");
      menukapa.addActionListener(this);

      menu.add(menukapa);
      menubar.add(menu);
      menubar.add(hakkimda);

      kapat=new Button("Kapat");
      kapat.addActionListener(this);

      yazdir=new Button("Geri");
      yazdir.addActionListener(this);


      kutu=new TextField("http://www.");
      kutu.addActionListener(this);

      webs=new JEditorPane();
      webs.setEditable(false);
      webs.addHyperlinkListener(this);

      setJMenuBar(menubar);
      c.setLayout(null);

      kay=new JScrollPane(webs);

      kay.setBounds(10,50,940,650);
      kutu.setBounds(10,20,740,25);
      dugme.setBounds(751,20,50,25);
      kapat.setBounds(803,20,50,25);
      yazdir.setBounds(855,20,50,25);

      c.add(kapat);
      c.add(kay);
      c.add(dugme);
      c.add(yazdir);
      c.add(kutu);
      show();
      }

   public void actionPerformed(ActionEvent e)
   {
      setTitle("Kachak Web Tarayici - Site Açýlýyor...");
      setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

      Object kaynak=e.getSource();
      String satir=kutu.getText();

      if (kaynak==dugme || kaynak==kutu)
      {
         try {
            webs.setPage(satir);
            setTitle("Kachak Web Tarayici - Açýldý");

         }
         catch (IOException ei)
         {
            try {
            webs.setPage("http://www.cmaeal.com/hata/hata.html");
            kutu.setText("hata: sayfaYok");

            }
            catch (IOException se) {
               System.out.print("Hata oldu..");
            }
         }
      }
      else if (kaynak==kapat)
      {
         System.exit(0);
      }

      else if (kaynak==hakkimda)
      {
      JOptionPane.showMessageDialog( this,"Sürüm 1.0","Yazan: Can
ÖKÇELIK",JOptionPane.INFORMATION_MESSAGE );

      }

      else if (kaynak==menukapa)
      {
         System.exit(0);
      }

      else if (kaynak==yazdir)
      {
         webs.setPage((String)yazdir.getEditor().getItem());
      }
   }

   public void hyperlinkUpdate( HyperlinkEvent ea )
   {
      if ( ea.getEventType() ==
      HyperlinkEvent.EventType.ACTIVATED )
   {
        try {
         webs.setPage( ea.getURL().toString() );
         kutu.setText(ea.getURL().toString());
      }
      catch (IOException ei)
      {
            try {
            webs.setPage("http://www.cmaeal.com/hata/hata.html");
            kutu.setText("hata: sayfaYok");
            }
            catch (IOException se) {
               System.out.print("Hata oldu..");
            }

         }
      }
   }


   public static void main(String[] args)
   {
      Tarayici t=new Tarayici();
      t.setVisible(true);
   }


}




Author mail : muhtemelen_ben@hotmail.com

_________________
Please recommend / share my post if you found it helpful.


Author:
Mastermind
User avatar Posts: 2694
Have thanks: 73 time
  Re: Java Web Browser (Mini Project)
Wed Mar 04, 2009 1:32 pm 
I personally use a small java brother.And heel Salutation.Can discrimination would even have a file given to you and have a look at it. (Java not give java.)


Author:
Newbie
User avatar Posts: 2
Have thanks: 0 time
  Re: Java Web Browser (Mini Project)
Wed Mar 04, 2009 1:35 pm 
Ben Can Ökçeliğin kardeşiyim.Java biliyorum ve dosyayıda veririm.


Author:
Newbie
User avatar Posts: 2
Have thanks: 0 time
Post new topic Reply to topic  [ 3 posts ] 

  Related Posts  to : Java Web Browser (Mini Project)
 code for my mini project     -  
 prapose me a web based mini project     -  
 need mini chat voice project.     -  
 I am doing my BCA final year. Looking out for a mini project     -  
 PC health of remote sever (Mini Project)     -  
 $.browser Check if your browser is IE or FireFox or Chrome     -  
 Video Archive Browser in java     -  
 java project     -  
 Help in My Java Project !!!!     -  
 Java Project     -  

All times are UTC [ DST ]



Topic Tags

Java Networking, Java Projects






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team