title: java Browser with static url
body: <p>I was able to get this work by entering the url. but what i need is there is a string variable to link the url and <strong>Autoload</strong> this page. And also make a button to exit by entering the password popup and exit.</p>
  
  <pre><code>import java.awt.BorderLayout;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  
  import javax.swing.JEditorPane;
  import javax.swing.JFrame;
  import javax.swing.JScrollPane;
  import javax.swing.JTextField;
  import javax.swing.event.HyperlinkEvent;
  import javax.swing.event.HyperlinkListener;
  
  public class main extends JFrame{
  
      private JTextField addressBar;
      private JEditorPane display;
      private String link = "http://www.google.lk";
  
      public main(){
  
          addressBar= new JTextField(link);
          addressBar.addActionListener(
                  new ActionListener() {
  
                      @Override
                      public void actionPerformed(ActionEvent e) {
                          // TODO Auto-generated method stub
                          loadCrap(e.getActionCommand());
                      }
                  }
                  );
          add(addressBar,BorderLayout.NORTH);
          display = new JEditorPane();
          display.setEditable(false);
          display.addHyperlinkListener(
                  new HyperlinkListener() {
  
                      @Override
                      public void hyperlinkUpdate(HyperlinkEvent e) {
                          // TODO Auto-generated method stub
                          //if(e.getEventType()==HyperlinkEvent.EventType.ACTIVATED){
                              loadCrap(e.getURL().toString());
                          //}
  
                      }
                  }
                  );
          add(new JScrollPane(display), BorderLayout.CENTER);
  
  
      }
  
      private void loadCrap(String usertext){
          try{
              display.setPage(usertext);
              addressBar.setText(usertext);
          }catch (Exception e){
              System.out.println("Shit!");
          }
  
      }
      public static void main(String[] args) {
          // TODO Auto-generated method stub
          JFrame browser = new main();
          browser.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          browser.setExtendedState(JFrame.MAXIMIZED_BOTH);
  
          browser.setUndecorated(true);
  
          browser.setVisible(true);
      }
  
  }
  </code></pre>