sae0203

Ranch Hand
+ Follow
since Sep 19, 2002
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 sae0203

Hello all,
can someone be so kinda as to tell me where i can download the package for netscape.javascript ?
and can it support window 2K and above... and i am currently using JCreator (a freeware) to do my java classes...
Thank you all in advance
SAE
--- I Tried searching for it but i am not sure which one to downloas ---
http://media.netscape.com/real/download.html
http://search.msn.com/results.aspx?q=download+package+netscape.javascript&FORM=SMCRT
18 years ago
Hello... so long didn't visit here liao...
anyway... hello to everyone...
in the meantime, can someone help me with my applet???
//----------- START ---------------
import java.awt.*;
import java.net.*;
import java.applet.*;
import java.awt.event.*;
//import wildtangent.webdriver.*;
public class Sae1 extends Applet implements ActionListener{

Button B1;
Button wtBtn;
URL input;

public void init()
{
B1 = new Button("EXIT");
B1.addActionListener(this);

wtBtn = new Button("WTStart");
wtBtn.addActionListener(this);

//Is this how i setup a path address??
input = new URL("http://www.yahoo.com");

add(B1);
add(wtBtn);
//add(input); // i assure i do not have to add it
}
public void actionPerformed(ActionEvent evt)
{
Object src=evt.getSource(); //returns object that caused event
//or is this another way to set urlfield
//urlField.setText("http://www.yahoo.com");
if(src==B1)
{
destroy();
}
if(src==wtBtn) // meaning the wtStart button
{
//can't get it to load a new window... wonder why
showWindow(input);
//getAppshowDocument("http://www.yahoo.com");
}
}

//end method actionPerformed()

public void paint(Graphics g)
{
g.drawString("Sharon Ambrosia Try Out", 50, 60);
}

public void destroy()
{
System.exit(0); // i set allow all permissions in the meeantime but what should be the correct way of doing it?
//repaint();
}

}
1.) How do i pop up a new window when user click on the wtStart button
2.) What is the correct way to close all window when the exit button is depressed. COZ now, i allow all permission.
3.) and has anyone heard of wildtangent and used it before???
coz, i had trouble importing the webdriver and i am sure my path is right. is it because i am using JCreator instead of Visual J++?
SAE - Thank you all in advance
18 years ago
Help is needed.
I need to do a webpage which include jsp code that validate the user input at the text area. i have read through some jsp tutorial but i am still unclear of how the codes works.
Below is the code which i had to just get the input and display it but what should i add to ask it to validate the input like lets say i only want user to input the character a,c,g,t if an invalid input is detected, it will display an error msg.
<html>
<head>
<Title>Testing</title>
</head>
<body>
<h1> Validation Testing</h1>
You typed :
<%
StringBuffer text = new StringBuffer(request.getParameter("txtarea1"));
int loc = (new String(text)).indexOf('\n');
while (loc>0) {
text.replace(loc, loc+1, "<BR>");
loc = (new String(text)).indexOf('\n');
}
//String seqArray[] = new String[100];
//seqArray = text;
out.println(" " + text);
//out.println("The array output: " + seqArray);
%>
</body>
</html>
18 years ago
JSP
Thanks... I will work on it now.
18 years ago
I need help... I want to do some file processing.
let's say,
example:
vir.txt
//contents of the text file
source 1..2607
/organism="Bovine adenovirus 1"
/mol_type="genomic DNA"
/strain="10"
/db_xref="taxon:10546"
/map="73.3-80.8 map units"
CDS 1..666
/codon_start=1
/product="hexon-associated structural protein pVIII
precursor"
/protein_id="AAC40820.1"
/db_xref="GI:3135468"
/translation="MSKDIPTPYVWTFQPQLGGCGASQDYSTRMNWLSAGPSMINQVN
SVRADRNRILLRQAAVSETPRLVRNPPTWPAQYLFQPIGAPQTFELPRNESLEVAMSN
SGMQLAGGGRRTKDIKPEDIVGRGLELNSDIPSASFLRPDGVFQLAGGSRSSFNPGLS
TLLTVQPASSLPRSGGIGEVQFVHEFVPSVYFQPFSGPPGTYPDEFIYNYDIVSDSVD
GYD"
enhancer 266..273
/note="putative lymphoid 1"
TATA_signal 348..354
/note="putative E3"
mRNA 374..2298
/product="E3"
/note="AraC resistant transcript"
Below is the code i have to extact the contents of some desirable portion:
public void extrCDS ( String aLine) {
int exist = -1;
exist = aLine.indexOf(_CDS );
if ( exist == 5 ) { //the position of the first letter
CDS = aLine.substring(_Pos2, aLine.length()-1);
//_Pos2 is the start of position of the string i want to display
try
{
VDesc.write ("CDS " + CDS + "\n");
System.out.print ("CDS " + CDS + "\n");
}
catch (IOException e)
{
e.printStackTrace();
System.out.println("Error=" + e );
}

}
}
output:
CDS 909..162
how can i get it to display the rest of the CDS portion from the next line?
eg CDS 909..162
Codon_start=1
product ="hexon-associated structural protein pVIII
precursor"
protein_id="AAC40820.1" etc...
18 years ago
below is the code i have for my JTable. but when i add the data type yes/no format true/false.how do i change the code in the column header so that it can accept the data type.....
URGENT HELP NEEDED thanks

import java.sql.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class TableDisplay extends JFrame
{
private Connection connection;
private JTable table;

public TableDisplay()
{
String url = "jdbc dbc:Mega Book";
String username = "anonymous";
String password = "guest";

//Load the driver to allow connection to the database
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

connection=DriverManager.getConnection
(url, username,password);
}

catch(ClassNotFoundException cnfex)
{
System.err.println("Failed to load JDBC/ODBC driver.");
cnfex.printStackTrace();
System.exit(1); //terminate program
}
catch(SQLException sqlex)
{
System.err.println("Unable to connect");
sqlex.printStackTrace();
}
getTable();

setSize(450, 150);
show();
}

private void getTable()
{
Statement statement;
ResultSet resultSet;

try
{
String query="SELECT * FROM Inventory"; //String query="SELECT * FROM Authors";

statement = connection.createStatement();
resultSet = statement.executeQuery(query);
displayResultSet(resultSet);
statement.close();
}
catch (SQLException sqlex)
{
sqlex.printStackTrace();
}
}

private void displayResultSet(ResultSet rs) throws SQLException
{
//position to first record
boolean moreRecords = rs.next();

//if there are no records, display a message
if(!moreRecords)
{
JOptionPane.showMessageDialog(this,"ResultSet contained no records");
setTitle("No records to display");
return;
}

setTitle("Inventory");

Vector columnHeads = new Vector();
Vector rows = new Vector();

try
{
//get column heads
ResultSetMetaData rsmd = rs.getMetaData();
for(int i=1; i<=rsmd.getColumnCount();++i)
columnHeads.addElement(rsmd.getColumnName(i));

//get row data
do
{
rows.addElement(getNextRow(rs,rsmd));
}while(rs.next());

//display table with ResultSet contents
table=new JTable(rows,columnHeads);
JScrollPane scroller = new JScrollPane(table);
getContentPane().add(scroller, BorderLayout.CENTER);
validate();
}
catch(SQLException sqlex)
{
sqlex.printStackTrace();
}
}

private Vector getNextRow(ResultSet rs, ResultSetMetaData rsmd)throws SQLException
{
Vector currentRow = new Vector();
for(int i=1; i<=rsmd.getColumnCount();i++)
switch(rsmd.getColumnType(i))
{
case Types.VARCHAR:currentRow.addElement(rs.getString(i));
break;
case Types.INTEGER:currentRow.addElement(new Long(rs.getLong(i)));
break;
default:System.out.println("ID was: " + rsmd.getColumnTypeName(i));
}

return currentRow;
}

public void shutDown()
{
try
{
connection.close();
}
catch(SQLException sqlex)
{
System.err.println("Unable to disconnect");
sqlex.printStackTrace();
}
}
public static void main(String args[])
{
final TableDisplay app=new TableDisplay();

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

}
);
}
}
19 years ago
heeheee... i really not familiar with java... how does the frame.repaint() works?
19 years ago
but the problem is the table won't shown if i add a boolean type data in the access... wat are the codes that i must add to fix this problem
19 years ago
why
mm... so that's why. thanks emil
19 years ago
why
why can't i add this in the container like this?

label1 = new JLabel("Type");
label2 = new JLabel("Product ID");
label3 = new JLabel("Stock Available");
label4 = new JLabel("Quantity Needed");
label5 = new JLabel("Estimated Buy In");
label6 = new JLabel("Needed By");
label7 = new JLabel("Total Cost");

pan5.add(label1, label2, label3, label4, label5, label6, label7);

txt1=new JTextField("",5);
txt2=new JTextField("",5);
txt3=new JTextField("",5);
txt4=new JTextField("",5);
txt5=new JTextField("",5);
txt6=new JTextField("",5);
txt7=new JTextField("",5);

pan4.add(txt1, txt2, txt3, txt4, txt5, txt6, txt7);
19 years ago
currently, i can only use for loop to display product 1 to 9... but it is unrelated to the items in the Access? how should i write the get.ProductID???

//items in thr list box
listModel = new DefaultListModel();
listModel.addElement("---ALL---");
//to display the products
for(int i=1; i<=9; i++)
{
listModel.addElement("Product " + i);
}
19 years ago
how can i link the JRadioButton with mulitiple TextFields? cause we really have problem doing it.
19 years ago
how can i link JRadioButton with JList... meaning when i click on the type book, the JList will display only the ID of book and not other thing else.
19 years ago