--- WebBrowser-old/WebBrowser.java 2001-11-01 18:09:12.000000000 +0000 +++ WebBrowser/WebBrowser.java 2003-05-16 10:34:16.000000000 +0100 @@ -18,6 +18,7 @@ import java.awt.event.*; import java.util.*; import java.net.*; +import javax.swing.*; import com.neva.*; import Shdocvw.*; import Mshtml.*; @@ -45,25 +46,25 @@ public Dimension getPreferredSize() { return new Dimension(400,200);} public Dimension getMinimumSize() { return new Dimension(50,50);} } -class ControlPanel extends java.awt.Panel { +class ControlPanel extends javax.swing.JPanel { public Dimension getPreferredSize() { return new Dimension(400,120);} public Dimension getMinimumSize() { return new Dimension(400,120);} } -public class WebBrowser extends Frame implements Shdocvw.DWebBrowserEvents2_If { - public Button go,stop,print,find; - public TextField url,search; - public Label status,lab1; +public class WebBrowser extends JFrame implements Shdocvw.DWebBrowserEvents2_If { + public JButton go,stop,print,find; + public JTextField url,search; + public JLabel status,lab1; public IE ie; public ControlPanel panel; public static void main(String [] param) { - new WebBrowser(param.length==0?"www.yahoo.com":param[0]); + new WebBrowser(param.length==0?"http://www.google.com/":param[0]); } public WebBrowser(String initUrl) { super("Internet Explorer"); - GridBagLayout gbl=new GridBagLayout(); - GridBagConstraints gbc=new GridBagConstraints(); - setLayout(gbl); + GridBagLayout gbl = new GridBagLayout(); + GridBagConstraints gbc = new GridBagConstraints(); + getContentPane().setLayout(gbl); gbc.gridwidth=GridBagConstraints.REMAINDER; gbc.anchor=GridBagConstraints.NORTH; gbc.weightx=1.0; @@ -71,19 +72,19 @@ gbc.fill=GridBagConstraints.BOTH; ie=new IE(this,initUrl); gbl.setConstraints(ie,gbc); - add(ie); - panel=new ControlPanel(); + getContentPane().add(ie); + panel = new ControlPanel(); panel.setLayout(null); gbc=new GridBagConstraints(); gbc.gridwidth=GridBagConstraints.REMAINDER; gbc.anchor=GridBagConstraints.SOUTH; gbl.setConstraints(panel,gbc); - add(panel); - url=new TextField("http://www.yahoo.com",255); + getContentPane().add(panel); + url=new JTextField("http://www.yahoo.com",255); panel.add(url); url.setBounds(105,30,250,20); url.setFont(new Font("Verdana",Font.PLAIN,12)); - go=new Button("Go"); + go=new JButton("Go"); panel.add(go); go.setBounds(50,30,40,20); go.addActionListener(new ActionListener() { @@ -96,7 +97,7 @@ } } }); - stop=new Button("Stop"); + stop=new JButton("Stop"); panel.add(stop); stop.setBounds(120,60,40,20); stop.addActionListener(new ActionListener() { @@ -109,7 +110,7 @@ } } }); - print=new Button("Print"); + print=new JButton("Print"); panel.add(print); print.setBounds(50,60,40,20); print.addActionListener(new ActionListener() { @@ -133,7 +134,7 @@ } } }); - find=new Button("..."); + find=new JButton("..."); panel.add(find); find.setBounds(360,30,40,20); find.addActionListener(new ActionListener() { @@ -149,15 +150,15 @@ } public boolean accept(java.io.File dir, String file) {return true;} }); - status=new Label("",Label.LEFT); + status=new JLabel("",Label.LEFT); panel.add(status); status.setBounds(50,10,300,15); status.setFont(new Font("Verdana",Font.PLAIN,12)); - lab1=new Label("Search:",Label.LEFT); + lab1=new JLabel("Search:",Label.LEFT); panel.add(lab1); lab1.setBounds(50,90,50,20); lab1.setFont(new Font("Verdana",Font.PLAIN,12)); - search=new TextField("",255); + search=new JTextField("",255); panel.add(search); search.setBounds(105,90,250,20); enableEvents(java.awt.event.WindowEvent.WINDOW_CLOSING); @@ -376,6 +377,17 @@ public void FileDownload(boolean [] /*[in out]*/ _Cancel ) {} public void StatusTextChange(String /*[in]*/ _Text ) {status.setText(_Text);} + + public void NavigateError(com.neva.COMIDispatch /*[in]*/ _pDisp , com.neva.COMVariant /*[in]*/ _URL , com.neva.COMVariant /*[in]*/ _Frame , com.neva.COMVariant /*[in]*/ _StatusCode , boolean [] /*[in out]*/ _Cancel ) {} + + public void PrintTemplateInstantiation(com.neva.COMIDispatch /*[in]*/ _pDisp ) {} + + public void PrintTemplateTeardown(com.neva.COMIDispatch /*[in]*/ _pDisp ) {} + + public void UpdatePageStatus(com.neva.COMIDispatch /*[in]*/ _pDisp , com.neva.COMVariant /*[in]*/ _nPage , com.neva.COMVariant /*[in]*/ _fDone ) {} + + public void PrivacyImpactedStateChange(boolean /*[in]*/ _bImpacted ) {} + public void DocumentComplete(com.neva.COMIDispatch /*[in]*/ _pDisp , com.neva.COMVariant /*[in]*/ _URL ) { try {