Archive for November, 2008

MechRC Robot

Sunday, 11 November 2008

MechRC Humanoid Robot from Trossen Robotics. Servomechanism, device which converts low-energy input to high-enery motion. Servos redound to power.

MechRC Humanoid Robot

MechRC Humanoid Robot

MechRC Humanoid Robot

MechRC Humanoid Robot

Features
The MechRC Robot comes pre-assembled.
Designed by the Transformer artist so there is a startling likeness to the Transformer form.
The ‘bot sports 17 servos with 180 degree movement..
Metal Gear Servos with 13kg-cm torque!
Audio can be played through the speaker in the robot’s chest.
More than 100 moves are pre-stored on the robot – see him throw some serious shapes fit for the dance floor or reveal his killer fighting moves.
An easy to use 3D visual interface is used for programming.
The robot is manipulated in an animation film strip making customizing seriously user-friendly.
IR remote control.
Lithium battery pack and charger.
MechRC Commander software CD ROM.
USB/Serial communications cable.
User Guide.
Requires a PC (not Mac compatible).
Suitable for ages 14 years+.
Size: 36 x 32 x 15cm.

Via:
Mechrc Robot
Trossen Robotics MechRC humanoid robot


MySQL & Swing, Eclipse

Saturday, 11 November 2008

Download the current version of mysql-connector-java from the MySQL products. And unzip the files somewhere. Create a new Java Project in Java Eclipse. Select the project and right clik and select Import, or follow File -> Import. In Import window select “Archive File”  and click Next button.  Press Browse button and find the mysql-connector-java-5.1.7-bin.jar file where were you unzip. And click Finish.  Create new package such as Pack. Create new class such as “MySQL_Swing” and select “public static void main(String[] args)” and then click the Finish button. And write your codes. Following is my sample MySQL_Swing.java codes. I write it for WordPress database.

Sample

Database name: ss3bf

User name: user

Pass: password

SQL Query:  SELECT display_name, user_email,user_nicename FROM wp_users
Code:

package pack;import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;public class MySQL_Swing extends JPanel implements ActionListener {
JButton button;
JTextField driver, url, user, pass;
JEditorPane status,sql;
/////// Window objects ///////
public MySQL_Swing(){
url=new JTextField(20);
url.setText("jdbc:mysql://localhost:3306/ss3bf");
sql=new JEditorPane();
sql.setPreferredSize(new Dimension(250,60));
sql.setBorder(BorderFactory.createEtchedBorder(1));
sql.setText("SELECT display_name, user_email,user_nicename FROM wp_users");
user=new JTextField(5);
user.setText("user");
pass=new JTextField(5);
pass.setText("password");
status=new JEditorPane();
status.setPreferredSize(new Dimension(250,250));
status.setBorder(BorderFactory.createEtchedBorder(1));
status.setAutoscrolls(true);
status.setText("Ready \r ");
button=new JButton("Button");
button.setActionCommand("action1");
button.addActionListener(this);
add(url);
add(sql);
add(user);
add(pass);
add(button);
add(status);
}
/////// Make Window ///////
private static void makeWin(){
JFrame.setDefaultLookAndFeelDecorated(true);
JFrame win=new JFrame("MySQL & Swing");
win.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
MySQL_Swing floor=new MySQL_Swing();
floor.setOpaque(true);
win.setContentPane(floor);
win.pack();
win.setSize(300,410);
win.setLocation(350, 300);
win.setVisible(true);
}
//////// Action //////
public void actionPerformed(ActionEvent e){
if("action1".equals(e.getActionCommand())){
try{
status.setText("\r Loading driver... \r "+status.getText());
Class.forName("com.mysql.jdbc.Driver").newInstance();
status.setText("\r driver loaded. \r "+status.getText());
status.setText("\r Connecting... \r "+status.getText());
Connection conn=DriverManager.getConnection(url.getText(),user.getText(),pass.getText());
status.setText("\r Connected. \r "+status.getText());
Statement sqlquery=conn.createStatement();
status.setText("\r Statement ready. \r "+status.getText());
ResultSet rs=sqlquery.executeQuery(sql.getText());
while(rs.next()){
status.setText(rs.getString("display_name")+" \r "+status.getText());
}
status.setText("Results: \r"+status.getText());
conn.close();
}catch(Exception e1){
status.setText(e1.getStackTrace().toString());
}
}
}
//////////////
public static void main(String[] args) {
makeWin();
}}

File list:
Directory of C:\Users\Y\workspace\Mysql-Swing
.classpath
.project
<DIR>bin
<DIR>com
<DIR>META-INF
mysql-connector-java-5.1.7-bin.jar
mysql-swing.jar
<DIR>org
<DIR>src

Screenshots:

MySQL Swing

MySQL & Swing

MySQL Swing

MySQL & Swing

Download: Whith source Mysql-Swing.zip

References:

http://www.cs.wcupa.edu/~rkline/mysql-java-win.html

http://www.neowin.net/forum/index.php?showtopic=697864


  • time time time…
  • Recent Comments

  • Lütfü Hoca

  • Roll

  • Ads