michael byrd

Greenhorn
+ Follow
since Jan 21, 2006
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 michael byrd

Hi.
I have an client application that controls a machine over the network.
However, I want to run the application on an Applet.
So, I created a new file called Appz.java:

public class Appz extends java.applet.Applet {

public GeradorDeFuncoes gf;
/** Creates a new instance of Appz */
public void init(){
gf = new GeradorDeFuncoes();
gf.setVisible(true);

}

}


GeradorDeFuncoes is the name of my application class that runs over JFrame.


then i created a HTML File (index.html):
<html>
<head>

<title> Eletronic Lab </title>
</head>

<applet code="geradordefuncoes.Appz" archive="AbsoluteLayout.jar">
</applet>

</html>





I opened the browser with this HTML file and:
java.io.EOFException
at java.io.DataInputStream.readInt(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.readInt(Unknown Source)
at java.io.ObjectInputStream.readInt(Unknown Source)
at javax.swing.ImageIcon.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readArray(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.access$300(Unknown Source)
at java.io.ObjectInputStream$GetFieldImpl.readFields(Unknown Source)
at java.io.ObjectInputStream.readFields(Unknown Source)
at java.awt.Container.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.beans.Beans.instantiate(Unknown Source)
at java.beans.Beans.instantiate(Unknown Source)
at geradordefuncoes.GeradorDeFuncoes.initComponents(GeradorDeFuncoes.java:732)
at geradordefuncoes.GeradorDeFuncoes.<init>(GeradorDeFuncoes.java:28)
at geradordefuncoes.Appz.init(Appz.java:22)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.security.AccessControlException: access denied (java.io.FilePermission /fotos/frequencia.JPG read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
at sun.awt.SunToolkit.getImage(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at geradordefuncoes.GeradorDeFuncoes.initComponents(GeradorDeFuncoes.java:1149)
at geradordefuncoes.GeradorDeFuncoes.<init>(GeradorDeFuncoes.java:28)
at geradordefuncoes.Appz.init(Appz.java:22)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.io.EOFException
at java.io.DataInputStream.readInt(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.readInt(Unknown Source)
at java.io.ObjectInputStream.readInt(Unknown Source)
at javax.swing.ImageIcon.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readArray(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.access$300(Unknown Source)
at java.io.ObjectInputStream$GetFieldImpl.readFields(Unknown Source)
at java.io.ObjectInputStream.readFields(Unknown Source)
at java.awt.Container.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.beans.Beans.instantiate(Unknown Source)
at java.beans.Beans.instantiate(Unknown Source)
at geradordefuncoes.GeradorDeFuncoes.initComponents(GeradorDeFuncoes.java:732)
at geradordefuncoes.GeradorDeFuncoes.<init>(GeradorDeFuncoes.java:28)
at geradordefuncoes.Appz.init(Appz.java:22)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.security.AccessControlException: access denied (java.io.FilePermission /fotos/frequencia.JPG read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
at sun.awt.SunToolkit.getImage(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at geradordefuncoes.GeradorDeFuncoes.initComponents(GeradorDeFuncoes.java:1149)
at geradordefuncoes.GeradorDeFuncoes.<init>(GeradorDeFuncoes.java:28)
at geradordefuncoes.Appz.init(Appz.java:22)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-geradordefuncoes.Appz" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)



Can someone help me plz?
15 years ago
I have an InputVerifier on a text field that does not allow loss of focus and beeps if the value is not valid. I assumed that when a button is pressed the InputVerifier of the text field would be called if it has focus and block the button press if the entry is not valid. However, even though the inputverifier is being called as attempting to block loss of focus (I get the beep), the button still gains focus and its actionPerformed method is called.

How do I modify my code to prevent the button from getting focus and its actionPerformed being called?
15 years ago
Hello frnds,

I am adding JSlider to my program.. when I want to change background and foreground color of JSlider, background color changes to black correctly..

but foreground color.. (I want to have numbers with JSlider in white).. does not change to white.. !!


JSlider framesPerSecond = new JSlider(JSlider.HORIZONTAL, FPS_MIN, FPS_MAX, FPS_INIT);
framesPerSecond.setBackground(Color.black);
framesPerSecond.setForeground(Color.white);



Is default numbers of JSlider part of Background??
If yes.. is there any way to change color of numbers.. ??
15 years ago
Hi,

I have installed MS SQL 2005 Evaluation version(downloaded from microsoft site) on my win2k3 Enterprise Edition I am writing a java application that connects to MS SQL 2005.

I have downloaded the MS SQL 2005 JDBC driver. And i unjarred the
I have unjarred the sqljdbc.jar file and kept the com folder and my .java file in the same folder.

When i am trying to connect, I am getting the following error:

-------------
com.microsoft.sqlserver.jdbc.SQLServerException: Failed Logon:com.microsoft.sqlserver.jdbc.SQLServerException: TCP/IP connection failed to host:155.35.54.160 java.net.ConnectException: Connection refused:connect
-------------

My code look like this:
---------------------------------------
try {
Class.forName ("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String fs = File.separator;

String conn_str = "jdbc:sqlserver://155.35.54.160:1433;user=sa;password=SA;databaseName=asdb";

conn = DriverManager.getConnection ( conn_str );
}
catch (Exception e) {System.out.println(e); }


Please reply.
it may sounds stupid...but i wonder why can you just delete...
15 years ago
to see if the resource on my website can help you
http://MichaelByrd.drivehq.com
15 years ago
it sounds interesting
15 years ago
I have a data file that will contain multiple XMLs that I need to parse into separate individual XML files that will be store in a database. Each individual file should start with the <statement> and end with </statement>. After I create a new XML file I need to extract the name from the newly created file before storing it in the database. Is there an easy way to do this? Here is the file :

<statement>
<name>John Dow </name>
<address>123 Main</address>
<phone>972-213-3434</phone>
</statement>
<statement>
<name>Jane Dow </name>
<address>345 Main</address>
<phone>972-213-3534</phone>
</statement>
<statement>
<name>Marry Dow </name>
<address>678 Main</address>
<phone>972-213-3435</phone>
</statement>


Thanks
Hi
How can I add the contents of XML DOC 1 into XML DOC 2 to produce something like XML DOC 3?

XML DOC 1

<Fruits>
<Apple>apples</Apple>
<Banana>bananas</Banana>
<Orange>oranges</Orange>
</Fruits>


XML DOC 2

<Fruits>
<Mango>mangos</Mango>
<Pears>pears</Pears>
<Litchi>litchi</Litchi>
<Grapes>grapes</Grapes>
</Fruits>


XML DOC 3

<Fruits>
<Apple>apples</Apple>
<Banana>bananas</Banana>
<Orange>oranges</Orange>
<Mango>mangos</Mango>
<Pears>pears</Pears>
<Litchi>litchi</Litchi>
<Grapes>grapes</Grapes>
</Fruits>
hi,

Anyone knows how to embed powerpoint presentation control by javabean and jsp ?

is it possible ?
I have a java program(MyCustomBean) which depends on other classes for it to successfully run. Now I need to create an ActiveX object for MyCustomBean. How do I include the other classes in my dll deployment? Do I create another jar with the depending classes and then create a dll for that? If so, how will MyCustomBean.dll know where to look for the classes it calls?

I am totally confused on this.

Can anybody please help?

Thanks
15 years ago
I've got an external java JMS client trying to connect to Sun Java System Application Server Platform Edition 8.1 2005Q1 and I need to know what to use for the Context.INITIAL_CONTEXT_FACTORY (and what jar it's in) plus the PROVIDER_URL for the following code:

Properties p = new Properties();
p.setProperty(Context.INITIAL_CONTEXT_FACTORY, ???);
p.setProperty(Context.PROVIDER_URL, ???);
Context ctx = new InitialContext(p);
QueueConnectionFactory qcf = (QueueConnectionFactory)ctx.lookup(factory);
15 years ago
Hi,

I am new in the area of connectivity and integration and I have a question regarding supporting XA transactions.
I have a EIS that supports XA transactions. Now, I want to integrate this EIS into a J2EE Application Server. Currently, there is no Resource Adapter (RA) implemented for this EIS.
Is it mandatory to supply a RA for this EIS in order to enable this system to participate in XA transactions? Can a EIS be connected to an Application Server without using JCA, and make XA transactions work?

Thanks,
15 years ago
hi,

i want to send file from applet to PHP, is there any way to do so?
15 years ago
Hi all,

I am trying to invoke a servlet from an applet. The applet contains a JTree structure and on selecting a node of the tree an event for the invocation of servlet is occured. I run this code and no exception comes in my browser java console. But the servlet doent even invoke and show its output.

Here is my applet code:

its init method.

public void init()
{

root = new DefaultMutableTreeNode("root", true);
node1 = new DefaultMutableTreeNode("node 1", true);
node2 = new DefaultMutableTreeNode("node 2" , true);
node3 = new DefaultMutableTreeNode("node 3", true);
root.add(node1);
node1.add(node2);
root.add(node3);
setLayout(new BorderLayout());
tree = new MyJTree(root);
add(new JScrollPane((JTree)tree),"Center");
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
//Listen for when the selection changes.
tree.addTreeSelectionListener(this);

}
public void valueChanged(TreeSelectionEvent e)
{
DefaultMutableTreeNode node = (DefaultMutableTreeNode)
tree.getLastSelectedPathComponent();

if (node == null) return;
Object nodeInfo = node.getUserObject();

if (node.isLeaf())
{
System.out.println("LEaf");
try
{
URL url = new URL("http://localhost:3265/AppletServlet/treeserv");
URLConnection uc = url.openConnection();
uc.setDoOutput(true);
uc.setDoInput(true);
uc.setUseCaches(false);
uc.setRequestProperty("Content-type", "application/x-www-form-urlencoded");
}
catch(MalformedURLException e5)
{System.out.println(e5.toString());}
catch(IOException e3)
{System.out.println(e3.toString());}
}
else
{
System.out.println("Root");
}
}

My servlet is perfect as it runs normally when i give its own address
in the browser.So i am not presenting its code here. Please send me sample code if possible

Thanks in advance,
15 years ago