Anthony Levis

Greenhorn
+ Follow
since Dec 15, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anthony Levis

the source code below is the method that i use to retrieve the data from the database...i have success retrieve the data but the value i get is no the value in database but just [Ljava.lang.object;@1855af5. actually the value in my database is JCX1234. how to solve this problem.how to change it to a string value.
can anyone help me.
10s.....


public void GetData(DefaultComboBoxModel cmodel) {

ResultSet rs = stmt.executeQuery("SELECT Bus_No FROM BusInfo");
//get metadata
ResultSetMetaData md = rs.getMetaData();
int colcount = md.getColumnCount();

Object[] data = new Object[colcount];
//extracting data

while (rs.next())
{
for (int i=1; i<=colcount; i++)
{
data[i-1] = rs.getString(i);

}
cmodel.addElement(data.toString());
//jcbbusno.addItem(data);
System.out.println(data);
}

}
how i can refresh the Jtable or the whole frame after i insert, modify or remove a record.

can anyone show me the example...

thank very much......
19 years ago
can anyone tell me how to detect the table cell selected when i use mouse to click the cell.

wat is the command use for the selected cell.

i want select a cell like ID_No and then show all the record of this ID into few TextField.

how to do it???

thank you.....
19 years ago
now i have create a JTable and i want retrieve the data from database. i want to add the data to the column. How to do it??can anyone give me some guidance and some example coding.

thank you very much.....
19 years ago
i want create a program that click a button and then show the internalframe at the main frame (JFrame) but i duno y my program cannot run it...

below the simple program that i create....
can any ppl tell me how to do it and y my program cannot run...

thank you!!!

=====================================================================

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;

public class a extends JFrame implements ActionListener{
JButton button_1;
JDesktopPane J;
private i I;

public a() {
JDesktopPane J= new JDesktopPane();
aLayout customLayout = new aLayout();

getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
getContentPane().setLayout(customLayout);

button_1 = new JButton("button_1");
getContentPane().add(button_1);
getContentPane().add(J, BorderLayout.CENTER);

addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});

button_1.addActionListener(this);
}

public void actionPerformed(ActionEvent ae){

J.add(new i());

}

public static void main(String args[]) {
a window = new a();
window.setTitle("a");
window.pack();
window.show();
}
}
19 years ago
Can anyone suggest what java development tools is good to develop the interface. I have download the Java Gui Builder .but i dun think it is good to use.

so i wish you can give the suggestion and where i can get it?


thank you....
19 years ago
The program below is example coding for create a MDI...
but i duno y the source code cannot run properly...

it show me that cannot find symbol variable WindowUtilities
and cannot find symbol class ExitListener

is it this 2 coding got any problem

WindowUtilities.setNativeLookAndFeel();
addWindowListener(new ExitListener());

can anyone tell me how to correct it...

if anyone got the example about creating MDI please show me also...
thank you......


====================================================================
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

class JInternalFrames extends JFrame{
public static void main(String [] args){
new JInternalFrames();

}

public JInternalFrames(){
super("Multiple Document Interface");
WindowUtilities.setNativeLookAndFeel();
addWindowListener(new ExitListener());
Container content = getContentPane();
content.setBackground(Color.white);

JDesktopPane desktop=new JDesktopPane();
desktop.setBackground(Color.white);
content.add(desktop, BorderLayout.CENTER);
setSize(450,400);
for(int i=0;i<5;i++){
JInternalFrame frame=new JInternalFrame(("Internal Frame " + i),true,true,true,true);
frame.setLocation(i*50+10,i*50+10);
frame.setBackground(Color.white);
frame.setSize(200,150);
frame.setVisible(true);
frame.moveToFront();
}
setVisible(true);
}
}
19 years ago
The program below is example coding for create a MDI...
but i duno y the source code cannot run properly...

it show me that cannot find symbol variable WindowUtilities
and cannot find symbol class ExitListener

is it this 2 coding got any problem

WindowUtilities.setNativeLookAndFeel();
addWindowListener(new ExitListener());

can anyone tell me how to correct it...
thank you......


====================================================================
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

class JInternalFrames extends JFrame{
public static void main(String [] args){
new JInternalFrames();

}

public JInternalFrames(){
super("Multiple Document Interface");
WindowUtilities.setNativeLookAndFeel();
addWindowListener(new ExitListener());
Container content = getContentPane();
content.setBackground(Color.white);

JDesktopPane desktop=new JDesktopPane();
desktop.setBackground(Color.white);
content.add(desktop, BorderLayout.CENTER);
setSize(450,400);
for(int i=0;i<5;i++){
JInternalFrame frame=new JInternalFrame(("Internal Frame " + i),true,true,true,true);
frame.setLocation(i*50+10,i*50+10);
frame.setBackground(Color.white);
frame.setSize(200,150);
frame.setVisible(true);
frame.moveToFront();
}
setVisible(true);
}
}
then can u tell me y this program cannot run in my pc...
y the result no print out AAA.....

it just show me Got an exception!
com.sybase.jdbc.SybDriver

i duno y it put "com.sybase.jdbc.SybDriver"
The source code below is the example code that i download from internet.
but i cannot run it...
when i run it, the result show me

>>Got an exception!
>>com.sybase.jdbc.SybDriver"

so i wish to know how to begin loading the driver and how i know the driver that i need to use.where i can get the driver name like "com.sybase.jdbc.SybDriver". i c many example, the driver name is different.

Help me plz.........
--------------------------------------------------------------------------
import java.sql.*;

class JdbcTest1 {

public static void main (String[] args) {
try {

// Step 1: Load the JDBC driver.
Class.forName("com.sybase.jdbc.SybDriver");

// Step 2: Establish the connection to the database.
String url = "jdbc:msql://www.myserver.com:1114/contact_mgr";
Connection conn = DriverManager.getConnection(url,"","");
System.out.println("AAA") ;

} catch (Exception e) {
System.err.println("Got an exception! ");
System.err.println(e.getMessage());
}
}
}