G
Guest
Gast
ich hab 2 codes der eine funzt der andere nicht:
hängt sich nicht auf:
hängt sich auf (und zwar wird wegen dem ott.httpt.go ein neues Fenster geöffnet aber das ist taub ich kann nirgends drauf klicken und das bereits geöffnete fenster ist ebenfalls taub
hängt sich nicht auf:
Code:
public static void main(String[] as){
HTTPConnection c=new HTTPConnection("www.google.de");
System.out.println(ott.httpt.go(c,"/index.html"));
}
hängt sich auf (und zwar wird wegen dem ott.httpt.go ein neues Fenster geöffnet aber das ist taub ich kann nirgends drauf klicken und das bereits geöffnete fenster ist ebenfalls taub
Code:
/*
* NewJFrame.java
*
* Created on 31. August 2006, 02:04
*/
package gui;
import HTTPClient.*;
import java.io.IOException;
import ott.*;
/**
*
* @author M
*/
public class NewJFrame extends javax.swing.JFrame {
HTTPConnection c;
/** Creates new form NewJFrame */
public NewJFrame() {
initComponents();
c=new HTTPConnection("www.google.de");
ott.httpt.go(c,"/index.html");
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">
private void initComponents() {
jTextField1 = new javax.swing.JTextField();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosed(java.awt.event.WindowEvent evt) {
exi(evt);
}
});
jTextField1.setText("www.google.de");
jTextField1.setToolTipText("Hello what website do you want to connect");
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jScrollPane1.setViewportView(jTextArea1);
jButton1.setText("visitpage");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
visti(evt);
}
});
jButton2.setText("get thing");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
visit(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton1))
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 261, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(28, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton2)
.addComponent(jButton1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 260, Short.MAX_VALUE)
.addContainerGap())
);
pack();
}// </editor-fold>
private void visit(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void visti(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void exi(java.awt.event.WindowEvent evt) {
// TODO add your handling code here:
System.exit(0);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NewJFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextField jTextField1;
// End of variables declaration
}
[code]