Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

pavan in

Ranch Hand
+ Follow
since Oct 22, 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 pavan in

Is it possible to find whether a particular node is visible to the user or not?
i.e, a node may be present in the jtree but since it's parent is collapsed, it's not visible to the user.any API?
any other indirect way to find this?
Thanks
17 years ago
Any idea on how to print an JTree in an applet?
or any utility/program which an convert applet to html so that I can use window.print() of javascript to print the applet?
Thanks.
17 years ago
So Tim, I can not print java applets on an browser? There must be some way we can print the applet.
Any utility which converts applet to html? basically, I have jtree in applet which is to be printed. Any suggestions on how to print the jtree?
17 years ago
public void printPage() {
try{
PrinterJob printJob = PrinterJob.getPrinterJob();
printJob.pageDialog(printJob.defaultPage());
printJob.setPrintable(this, printJob.defaultPage());
if(printJob.printDialog()){
printJob.print();
}
return;
}
catch(PrinterException pe) {
EuamAppletLogger.error(pe, "Exception Caught");
}
}

/**
* Prints the page at the specified index into the specified Graphics context in the specified format.
*
* @param g
* @param pg
* @param page
*
* @return int
*/
public int print(Graphics g, PageFormat pg, int page) throws PrinterException {
Graphics2D g2 = (Graphics2D) g;
if (page >= 1)
return Printable.NO_SUCH_PAGE;
g2.translate(pg.getImageableX(), pg.getImageableY());
paint (g2);
System.gc();
return PAGE_EXISTS;
}
this code pops-up 'An applet would like to print. Do you want to continue?' but the browser just hungs there. I am not able to click on yes/no option. Any thought?
Thanks
17 years ago
Is it possible to print applet using the printer. If yes, how?
I have a button on my applet. When the user clicks on that button, the applet should be printed. My applet is not signed.
Thanks
17 years ago
I dont want the listener to be added to the text on the left hand side. MouseListener will corresponds to the whole text (left and right), isnt it?
How do I add listener to the cell renderer?
17 years ago
Nathan,
Is it possible to associate an listener (say, mouseClick) on the text displayed on the right hand side of the node data.
i.e, for the text '100 A', can I associate an listener to the text 'A' so that when the user clicks on 'A', some method is called.
Thanks
17 years ago
Is it possible to revert the jtree node selection to it's previous selection when i see a flag set.
i.e, say node A is selected. User new selects node B while flag is true. I want the node selection to be reverted back so that node A is selected again.
I am using the following code in valueChanged() method of TreeSelectionListener class. but, this keeps calling itself and hence not a good code. any other way(s)?
JTree jtree = (JTree)event.getSource();
if(f_IsAddTempNode) {
TreePath oldPath = event.getOldLeadSelectionPath();
EuamDefaultMutableTreeNode node = (EuamDefaultMutableTreeNode)oldPath.getLastPathComponent();
setTreeSelection(jtree, node);
return;
}
Thanks.
17 years ago
We have developed a website with JSP front end which has to work for both http and https requests.
The site works perfectly for http request. But, for https request, it throws 500 error when we submit the page. i.e, form.submit() throws 500 error. Has anyone come across this strange problem?
Trying to figure out this problem for more than 4-5 days now. No luck yet.
Application server is weblogic 7.
MVC architecture -> JSP - Servlet - Model - Backend.
Thanks a loot.
[ March 30, 2003: Message edited by: pavan in ]
17 years ago
JSP
Nathan,
Once I select node 2 in the tree, the node 1 which was blinking gets deselected and node 2 is highlighted. but, i want node 1 to blink while node 2 is highlighted.
17 years ago
Nathan,
In the above example, when i select node 2, the node 1 stops blinking. because, 'value' is changed when the user selects another node.isnt it?
17 years ago
Thanks Nathan.
I should make the tree -> jtree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
is it right?
But, I want only one node to be selected at any point.so, i have set the selection model as SINGLE_TREE_SELECTION.
is it possible to make the node 1 blinking and still be able to select only 1 node?
17 years ago
Nathan,
One more requirement.
when the user clicks on node 1 and clicks start.Node 1 should start blinking (works fine with the code you have given)). Now, the user clicks on another node (node 2). node 1 should be blinking while node 2 should be shown as normal selection. is it possible to do this task?
Thanks.
17 years ago
Cool. Thanks a looot.
17 years ago
Is it possible to make a node blinking in jtree?If yes, how?
When the usr clicks on a button, I want the node selected to start blinking and when the user clicks on another button, it should stop blinking.
Thanks.
17 years ago