Im using netbeans with design (palette). I want to show my output console into GUI in netbeans. So here is my code that I want to execute. I put this to button function, and it works. But I the result show up in output console, I intention to show it in the interface too.
User user = status.getUser();
Date dated = status.getCreatedAt();
PreparedStatement stmt = null;
Connection conne = null;
try {
Class.forName("com.mysql.jdbc.Driver");
System.out.println("Connecting to database...");
conne = DriverManager.getConnection("jdbc:mysql://localhost/jat?useUnicode=true&characterEncoding=UTF-8", "root", "");
System.out.println(status);
System.out.println("Inserting records into the table...");
stmt = conne.prepareStatement("set names 'utf8'");
stmt.execute();
stmt = conne.prepareStatement("set character set utf8");
stmt.execute();
stmt = conne.prepareStatement("INSERT INTO tweet(ID,date,name,statusLocation,text,source) VALUES (?,?,?,?,?,?)");
stmt.setInt(1, (int) status.getId());
stmt.setString(2, getTimeStamp());
stmt.setString(3, status.getUser().getScreenName());
stmt.setString(4, user.getLocation());
stmt.setString(5, status.getText());
stmt.setString(6, status.getSource());
stmt.executeUpdate();
System.out.println("this record inserted!");
System.out.println("==================");
} catch (SQLException se) {
se.printStackTrace();
} catch (final Exception e) {
e.printStackTrace();
}
}
@Override
public void onTrackLimitationNotice(int arg0) {
}
@Override
public void onStallWarning(StallWarning sw) {
throw new UnsupportedOperationException("Not supported yet.");
}
};
FilterQuery fq = new FilterQuery();
double lat1 = 121.300000d;
double long1 = 25.020000d;
double lat2 = 121.380000d;
double long2 = 25.030000d;
twitterStream.addListener(listener);
double[][] bb = {{lat1, long1}, {lat2, long2}};
fq.locations(bb);
twitterStream.filter(fq);}
When the 'run' button executed, the result just displayed in the output console, not in my interface.
And this is my interface look like:
Thank you so much for any reply