Mohammed Ajmal

Greenhorn
+ Follow
since Sep 20, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Mohammed Ajmal

Hi All,

I have an use where EJB will be running on one server and CGI running on some other server. The client requests EJB which services the request by making a call to other server which uses CGI to do file Operation.

I need help regarding the feasibilty of using session beans to make CGI calls and do some file IO operation.

I have to write a session bean which calls a CGI script running on other server. So, I'm planning to use URL class[URL fileCopy = new URL("http://www.nitk.edu/" + "cgi-instruct/test/fileInfo");
URLConnection connection = fileCopy.openConnection();]
and open a connection to server ( Apache webserver) and execute the file IO operation.

The file operation is to copy Files whose size range is 50-400 MB.
I need information about its disadvantages if any any other alternative of doing this.

So, please let me know your suggestions/comments on the same.

Thanks.
Hi,

I have a general question related to refreshing the contents of JTable and handling some application specific requirements.In our application we are planning to refresh the contents of JTable automatically after certain period of time by fetching data from database and update the JTable contents or user has clicked refresh button.

But following scenarios we are planning to handle when refresh is called automatically or user has clicked refresh button.

1) User is working with data of JTable. Like rows of JTable has checkBoxes and user selects them and doing operation like viewing the details of selected rows in new details dialog. So if refreshing is done then the selection will be lost if I update the whole data in JTable.

a)Will it be possible to append the data at the end of JTable rows without disturbing the existing JTable contents.

b) Is it feasible to compare the data of existing rows and newly fetched rows and update only the rows whose values are changed in database or update specifically updated columns. But this comparision for finding changed values will result in performance problems.So are there any other alternatives of doing this, ideas are most welcome.

c) Simple way is to alert the user that data will be updated and everything will be refreshed will be the choice in worst case.

I guess many may have encountered such problems and may have solved it depending on the product requirements.

Ideas and suggestions are most welcome.


Regards.
19 years ago
Hi All,

This is a class which extends JTree class forms a Tree displaying employee information.Listener is written which should find the list of selected Employee nodes of tree component.

The method valueChanged() of treeListener is getting called twice for every node selected. Please find the code.

Is there any alternative to find the list of selected nodes when they are selected using mouse or shift key.

Even I am facing this in case of row selection of JTable.The listener method is called twice. Could you please let me know your views and any tutorials or examples codes for handling such cases.


public class TestingTreeModel extends JTree {

//public vector myMOType;

public TestingTreeModel() {
super();
}


public void setData(ArrayList testVOs) {


// set the option of selecting multiple nodes
this.getSelectionModel().setSelectionMode(
TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
this.setRootVisible(false);

setModel(rootTreeNode, testVOs);

// DefaultTreeModel is used.
this.setModel(new DefaultTreeModel(rootTreeNode));

// Listener for selected nodes..
MyTreeSelectionListener myTreeListener = new MyTreeSelectionListener();
this.addTreeSelectionListener(myTreeListener);


}

// which sets the data.

public void setModel(DefaultMutableTreeNode rootNode, ArrayList empVOs) {
if empVOs!= null && empVOs.size() > 0) {
Iterator empItr = empVOs.iterator();
while (neItr.hasNext()) {
Employee empVO = (Employee) empItr.next();
DefaultMutableTreeNode node =
new DefaultMutableTreeNode(empVO.getName());
rootNode.add(node);

}
}
}


// Listener

public class MyTreeSelectionListener implements TreeSelectionListener {
public void valueChanged(TreeSelectionEvent evt) {
// Get all nodes whose selection status has changed
System.err.println("Listener is called here check how many times");
getSelectedNodes(evt);
}
}


private void getSelectedNodes(TreeSelectionEvent evt) {

System.err.println("came inside getSelectedNodes");

TreePath[] paths = evt.getPaths();
// Iterate through all affected nodes

System.err.println(" Length is " + paths.length);

for (int i = 0; i < paths.length; i++) {
TreePath tp = paths;
Object[] o = tp.getPath();
for (int j = 0; j < o.length; j++) {
System.out.println(
"Class: " + o[j].getClass() + "; value: " + o[j]);
if (o[j] instanceof DefaultMutableTreeNode) {
Object uo = ((DefaultMutableTreeNode) o[j]).getUserObject();
if (uo != null) {
System.out.println(
"\tUser object class: "
+ uo.getClass()
+ "; value: "
+ uo);
}
}
}
}
}
private ArrayList empIDList = new ArrayList();
private DefaultMutableTreeNode rootTreeNode = null;
}
19 years ago
Hi,

Can anyone post tutorials or links on using JProbe with WebSphere 5.x.
Also,if any other free tool for knowing performance and memory utilization which can be easily integrated with WSAD.

Thanks.
19 years ago
Hell�,

I need information on using ComboBoxes as Tablecolumns of JTable.
The requirement is like below the TableHeader which has columns combo boxes should appear.That is first row of table should contain combo boxes which contains all values of that column. So that user can filter by selecting the value or entering some search criteria. It is similar to excel format where user can pick values from list.

Could anyone post some sample code or links where such examples or tutorials describes about comboboxes usage as I require.

Thanks.
19 years ago
Hi,

I have a question regarding using session facade design pattern. I have gone through the tutorials it gave examples with sesssion facade with entity beans not stateless session beans. So, can I use session facade with stateless session beans.

I have developed some stateless session beans for Searching, RetrieveJobDetails and other functions separately as one session bean for every requirement.So I want to use the design patterns like Business delegate,Service Locato,Session facade.So,is it Ok if I use all these design patterns for my application.

Please throw some light and ideas/comments are appreciated.

Thanks.
Hi,

Application was working fine and we upgraded to java1.4.2 and no changes done in java code. In my case, whenever user presses F1 key, the key event is getting handled correctly and it is opening help page.

But now the event is not getting captured even though there is a listener to catch.

Below is the code snippet.

------------------------


private void HelpKey()
{
try
{
java.awt.event.KeyListener keyListener = new java.awt.event.KeyAdapter()
{
public void keyReleased( java.awt.event.KeyEvent e )
{
// Check that the key released was F1
// and that some component was active
if ( getFocusOwner() != null && e.getKeyCode() == java.awt.event.KeyEvent.VK_F1 )
{ // Finally call the method in my controller and
// pass the active component as an argument
FormHelpURL( getFocusOwner() );
}

}
};
// add previously created listener to this window
addKeyListener( keyListener );
}


Could you please throw some light and give some pointers....

Thanks in advance.
19 years ago
Hi,
You need to add Mouselistener to the table Header.

Try using the below code:

VTable m_table = new VTable(rowData,colNames,false); m_table.getTableHeader().addMouseListener(new java.awt.event.MouseListener(){ public void mouseClicked(MouseEvent e) { System.out.println("TEST!!!"); }

Thanks,
20 years ago
Hi,

I need to to fix the width of a particular column with some predefined size and it should be resizable while other columns widths should be resizable.

I tried by using



//It resizes all columns
empTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);

// To resize a particluar column
empTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
int vColIndex = 1;
javax.swing.table.TableColumn tableColumn = tableActivePlans.getColumnModel().getColumn(vColIndex);
int width = 20;
tableColumn.setPreferredWidth(width);

But here the other columns are not of default size and scroll bar is getting created and last columns are getting minimum size,which will happen. But I need rest columns to be of same size.

Thanks,
20 years ago
Hi,

Thanks for the information. If I download the J2ME wireless toolkit then i can run simple runs?

There is not necessity of any hardware or emulator?

Thanks,
Ajmal.
20 years ago
Hi All,

I am interested in learning in J2ME and I am newbee to this.
I know J2SE and J2EE. But I heard we need some special toolkits and emulators to use J2ME and to write programs.

Please let me know how to start/learning J2ME.

I want to start learning J2ME by developing simple applications and what are the hardware and software requirements for the same.

Your tips and pointers are highly appreciated.

Thanks.
20 years ago
Hi,

I have written a parser in java using SAXParser.
Also, schema validation is done. So when I give a incorrect xml it throws SAXException and I am able to catch the same. But on catching it I am conveting it to userDefined exception and throwing the same to client(java application), but on catching the same in client it is getting converted to null pointer exception and i have to put a catch( Exception ex) block to catch it, it is not getting catched in userdefined catch block.

code snippet
----------------------------
parser:

method parseInput (...) throws parseException

catch(SAXException sx)
{
throw new parseException( sx.getMessage());
}

client:

try
{
parseInput()
}
catch( parseException pe )
{
...
}
catch ( Exception e)
{
// Here it is getting caught.
System.out.println(" prints exception message as " + e.getMessage())) as NULL.
}
}

-- End -----------------------------------

Could some one throw pointers on the same.

Your help is highly appreciated and thanks for the same.
20 years ago
Hi,

I have jar and war file which I deploy it in weblogic server.
Now I have to use Websphere. Also, the war and jar file need to be packaged into rpm which can be installed to deploy on WEBSPHERE running on RED HAT LINUX.

Could any one throw pointers on how to proceed and any tutorials on the same are appreciated. Thanks in advance.
20 years ago
Hi Craig,

Thanks very much for your code,it is useful to me and solve my problem.

--
Ajmal.
20 years ago
Hi,

I am using JOptionPane.showConfirmDialog(..) to display a message where sometimes the message is so big that it displays the dialog with buttons not visible properly to the user. In such cases the message should get wrapped and should appear in the scrollbar.

Is there any way to wrap the message and display properly.

Or Should we have to write out own dialog box for acheiving the same.

Thanks in advance for your inputs.
20 years ago