Aditya Singh

Ranch Hand
+ Follow
since Mar 06, 2008
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 Aditya Singh

Thanks for reply but this is all basic work already done.
14 years ago
Hi,
I have applet-servlet communication code inplace it has read and connection timeout values set.
This servlet inturns communicate to c++ code using JAX-RPC. Problem comes when I get proper
connection but a very long stream back from servlet/ send a long stream to servlet .. Applet seems
to be hanged !! . I tried writting a new thread and calling it using invoke later but could
not do achive asnychronous behavior . Any pointer will be helpful.

Thanks in advance.

Regards,
Aditya
14 years ago
Thanks for reply.

I am still wondering, Is there any inbuilt component like JOptionPane when it comes .. it will block all applet of same webpage.
15 years ago
Hi,

I created a web page with 3 applet using swings components. Requirement is to disable this webpage (all three applet) when one of them shows a popup.

I used java swings popup class to get this popup which has only show/ hide method so I am not finding a way to disable all three applet when this popup is shown.

Thanks in advance for your suggestion.

Regards,
Aditya
15 years ago
Hi, I am archiving my signed jar files in html so it becomes sticky.
Once in a while I am getting exception as FileNotFound. This error goes off we we clear Sun Application Data from deployment cache. I am using IE6 with jvm 1.5.

Thanks in advance.
15 years ago
Thanks Ulf.

I din't expected answer as NO, I thought there must be some work around?

Currently I am encrypting parameter passed to JSP so that user don't understand about them.
15 years ago
Thanks Ulf.

I am using HttpUrlConnection to communicate to servlet and its working fine.
Is there any way to pass control and post data to jsp page at the same time?
15 years ago
Hi,

To send control from applet to jsp we call context.showDocument(url). I am sending some parameter by appending them with query string.

I am wondering if there is some way to send parameter in the body of request. In other word calling it like post?

Thanks in advance.
15 years ago
Hi,
I got a sample program for showing JButton in JTable. I modified it to show Jtree in Jtable column. But its not working.
Here is the code,


package com.ubs;

import java.awt.*;
import java.awt.event.*;
import java.util.*;

import javax.swing.*;
import javax.swing.table.*;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;

public class TreeTable extends JFrame
{
public TreeTable()
{
String[] columnNames = {"Date", "String", "Integer", "Decimal", ""};
Object[][] data =
{
{new Date(), "A", new Integer(1), new Double(5.1), "Tree0"},
{new Date(), "B", new Integer(2), new Double(6.2), "Tree1"},
{new Date(), "C", new Integer(3), new Double(7.3), "Tree2"},
{new Date(), "D", new Integer(4), new Double(8.4), "Tree3"}
};

DefaultTableModel model = new DefaultTableModel(data, columnNames);
JTable table = new JTable( model )
{
// Returning the Class of each column will allow different
// renderers to be used based on Class
public Class getColumnClass(int column)
{
return getValueAt(0, column).getClass();
}
};

JScrollPane scrollPane = new JScrollPane( table );
getContentPane().add( scrollPane );

// Create button column
Tree buttonColumn = new Tree(table, 4);
}

public static void main(String[] args)
{
TreeTable frame = new TreeTable();
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
frame.pack();
frame.setVisible(true);
}

class Tree extends AbstractCellEditor
implements TableCellRenderer, TableCellEditor, ActionListener
{
JTable table;
JTree renderButton;
JTree editButton;
String text;

public Tree(JTable table, int column)
{
super();
this.table = table;
renderButton = new JTree();

editButton = new JTree();
//editButton.setFocusPainted( false );
//editButton.addActionListener( this );

TableColumnModel columnModel = table.getColumnModel();
columnModel.getColumn(column).setCellRenderer( this );
columnModel.getColumn(column).setCellEditor( this );
}

public Component getTableCellRendererComponent(
JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
{
if (hasFocus)
{
renderButton.setForeground(table.getForeground());
renderButton.setBackground(UIManager.getColor("Button.background"));
}
else if (isSelected)
{
renderButton.setForeground(table.getSelectionForeground());
renderButton.setBackground(table.getSelectionBackground());
}
else
{
renderButton.setForeground(table.getForeground());
renderButton.setBackground(UIManager.getColor("Button.background"));
}

DefaultTreeModel treeModel = createDataModel();
renderButton.setModel(treeModel);
return renderButton;
}

private DefaultTreeModel createDataModel() {
//IconNode[] nodes = new IconNode[strs.length];

DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");
DefaultMutableTreeNode child = new DefaultMutableTreeNode("child");
child.add(new DefaultMutableTreeNode("dummy"));

root.add(child);
return new DefaultTreeModel(root);
}


public Component getTableCellEditorComponent(
JTable table, Object value, boolean isSelected, int row, int column)
{
text = (value == null) ? "" : value.toString();
//editButton.setText( text );
DefaultTreeModel treeModel = createDataModel();
editButton.setModel(treeModel);;
return editButton;
}

public Object getCellEditorValue()
{
return text;
}

public void actionPerformed(ActionEvent e)
{
fireEditingStopped();
System.out.println( e.getActionCommand() + " : " + table.getSelectedRow());
}
}
}
15 years ago
Hi Ulf,

Thanks for reply.

I too expected same and now its working. There was some problem in connection with other server. Thanks.

Regards,
Aditya
15 years ago
Thanks Bear for response. I changed the design to Applet-Servlet interaction. I feel using java inbuilt classes gives more control to programmer. We were targeting IE6 and could not find time to test on other browser.

Regards,
Aditya
Hi Bear,
Its IE6. I have not tested on other browsers. I too not sure why its happending. Does it has to do any thing with the way I am implementing my logic of returning 304? I am not using time stamps but comparing old data with new data. If no change then returning 304.
Hi,

I have an applet communicating to a servlet. this servlet will communicate to remote server. problem here is, if servlet communicate to remote server then applet is not allowed to communicate with it else it allows.

I know applet has many restriction but is this restriction also there?

Thanks.
15 years ago
Thanks Eric, but this also not working.
Hi,
I have following function in java script.

function timedRefresh(timeoutPeriod) {
setTimeout("location.reload();",timeoutPeriod);
}

Problem happens when Server doesn't return body content but returns SC_NOT_MODIFIED. Page get cleared in this case( No Content since response body is not there). I am not sure how to retain previous content in browser.

Thanks.