Sumana Reddy

Greenhorn
+ Follow
since Oct 28, 2000
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 Sumana Reddy

I am a novice to Java Printing API.After spending sometime on Printing API, I came to know that we can pop up printDialog for printer selection
using either
PrinterJob.getPrinterJob().printDialog()
or
ServiceUI.printDialog(gc, x ,y, printServices, defaultService, flavour)
Both the above PrintDialog boxs display the list of all available printers on your computer
I want to restrict these printers list to only certain printers.This is beacuse we restrict our users to print only on certified printers.So in the printDialog box, I want to list only those certified printers that are installed on their computer
I don't use Java printing API for actual printing.I use Java Printing API only for poping up the printDialog for printer selection and get the user selected printer info.I then pass the selected printer info to another application that takes care of printing to the specified printer
How can I acheive this?
Can you please tell me if there are any good tutorials, books or sample progrmas on java printing
I appreciate your valuable time and help
Thanks
Sumana
20 years ago
I have a modal dialog box.When ever I make the dialog box visible I need to request the focus for a particular button.
below is the description of how I tried to achieve the functionality
I can request the focus by calling requestFocus method.We should request the focus only when the component is visible i.e only after i make the dialog box visible.But when a modal dialog box is visible it blocks the application and the requestFoucs method is not executed as long as the dialog is visible.
So in order to solve this problem I decided not to make my dialog modal during creation time.When I make my dialog visible, First i will request the focus and then make the dialog modal.But once the dialog is visible the modal concept is not working.thoght the setModal() is executed and the dialog.isModal() returns true But somehow the dialog is not modal on the application.
So I tried to implement this modal functionality as you suggested i.e enabled and disabling the parent.That works pretty fine.But when I close the dialog box The parent frame is hidden and someother window that's on task bar will be in the front.
So when I close the dialog I call the parent.toFront() to make it appear infront of all windows.when the dialog is closed the parent frame will come to front after some flickering.That flickering is real bad.
Is there any better solution for the above problem.
Thanks Sumana
21 years ago
Hi,
When I tried to print a PDF document using JAVA 1.4 Printing API, I got the following exception.
______________________________________
Exception in thread "main" sun.print.PrintJobFlavorException: invalid flavor
at sun.print.Win32PrintJob.print(Win32PrintJob.java:290)
at Printing.main(Printing.java:40)
_________________________________________________________________
I am able to print the same PDF document using Acrobat reader.
Is PDF format not supported in JAVA 1.4 printing API? or is something wrong in my code?
here is the sample JAVA program that I was using
import javax.print.*;
import javax.print.attribute.*;
import java.io.*;
public class Printing {
public static void main(String args[]) throws Exception {
String filename = args[0];
PrintRequestAttributeSet pras =
new HashPrintRequestAttributeSet();
DocFlavor flavor = DocFlavor.INPUT_STREAM.PDF;
PrintService defaultService =
PrintServiceLookup.lookupDefaultPrintService();
DocPrintJob job = defaultService.createPrintJob();
FileInputStream fis = new FileInputStream(filename);
DocAttributeSet das = new HashDocAttributeSet();
Doc doc = new SimpleDoc(fis, flavor, das);
job.print(doc, pras);
Thread.sleep(10000);
System.exit(0);
}
}

Thank you
Sumana
21 years ago
Hi,
I created a dialog box that extends from JDialog.I want to close the dialog box only when user selects one of the buttons present in the dialog box.I setDefaultCloseOption to DO_NOTHING_ON_CLOSE so that dialog box will not close when X icon (present on the top right corner of any JDialog) is clicked.
Can I disable this X icon, so that the user understands by seeing it that he cant click that button.If yes, how should I do that.
Regards, Sumana
21 years ago
Rene Liebmann
Thank you for your reply.
I tried Java based Acrobat Viewer.But it has got font problems and out of memory problem.I could not open my PDF file in it.Adobe has no support for it and I came to know through the user forums that many others using it have got the same problems and suggested not to go for it as Adobe has no plans of improving it in future.
Do you know any URLS or links other than Adobe from where I can get more information about Acrobat viewer?
I appreciate your help and time
Regards
Sumana
21 years ago
I need to view PDF files and also print PDF files from Swing application.How do I do that?I appreciate your help
Thanks
Sumana Somareddy
21 years ago
Thanks to John and Carlisia. The websites you both mentioned were really helpful.
Regards
Sumana
22 years ago
Thanks Carlisia for your suggestion.But unfortunately I didn't do my BS in US.
Good Luck to you too.
Regards
Sumana Reddy
[ February 06, 2002: Message edited by: Sumana Reddy ]
22 years ago
Hello All,
Iam a Sun certified programmer with 2 1/2 yrs of experience.But I have Very less experience in US.I have only 10 months of experience in US.I am now out of project.I am having a tough time with my job search as no one is responding.I would like to work as an intern (no matter whether they pay or not)so that I can gain atleast some work experience, instead of being idle.Am I eligible for intern as most of the internships are for graduate students.I completed my BS in 1999.If so Please tell me some goow websites where I can find Internships especially in NJ, NY, CT and MA.
Thanks
Sumana
22 years ago
Thanks Ketan.I tried the way you said.It's working now.
Thanks
Sumana
22 years ago
Hello,
I wrote a simple session EJB and tested it using the Test Client option that's present in VAJ.It's working perfect.Later i wrote a Client class and tried to access the EJB, the folowing exception is thrown
"javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.ejs.ns.jndi.CNInitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.ibm.ejs.ns.jndi.CNInitialContextFactory]"
Why is it not able to find CNInitialContextFactory class
Please help me.
Thanks
Sumana
22 years ago
Hello,
I wrote a simple JSP file in VAJ and tried to run it using WTE.when tried to load the JSP file in Browser,It says page not found.What should be the URL?I read in the online help that the URL must match the file structure of your Document root.What does that exactly mean.I am not clear where these JSP files are stored and how does WTE look for them.Can you please explain me about this.
Thanks
Sumana
22 years ago
hi bill,
Thanks .
what u said was right.i went through my tld and web.xml again.
i forgot to mention DOCTYPE in web.xml.
my program is working now after correcting the mistake.
Thanks again
Sumana
23 years ago
I am new to JSP custom tags
when i tried to run my first example using custom tags
in JRUN i am getting the error
_______________________________
500 Internal Server Error
/tagext/jsp/hello1.jsp:
javax.servlet.ServletException: javax.servlet.jsp.tagext.TagData: method getAttributes()Ljava/util/Enumeration; not found
java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagData: method getAttributes()Ljava/util/Enumeration; not found
at allaire.jrun.jsp.JSPParser.validateTagAttributes(JSPParser.java, Compiled Code)
at allaire.jrun.jsp.JSPParser.action(JSPParser.java:962)
at allaire.jrun.jsp.JSPParser.parse(JSPParser.java, Compiled Code)
at allaire.jrun.jsp.JSPParser.writeXML(JSPParser.java:151)
at allaire.jrun.jsp.JSPParser.generateXML(JSPParser.java:123)
at allaire.jrun.jsp.JSPParser.generateXML(JSPParser.java:67)
at allaire.jrun.jsp.JSPServlet.parsePage(JSPServlet.java:409)
at allaire.jrun.jsp.JSPServlet.createServlet(JSPServlet.java:381)
at allaire.jrun.jsp.JSPServlet.loadPage(JSPServlet.java:202)
at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:169)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java, Compiled Code)
at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
at allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:107)
at allaire.jrun.ThreadPool.run(ThreadPool.java, Compiled Code)
at allaire.jrun.WorkerThread.run(WorkerThread.java, Compiled Code)
___________________________
when i tried to run the same example in TOMCAT i am getting the
error
_____________________________________________________
Error: 500
Location: /hello/jsp/hello1.jsp
Internal Servlet Error:
org.apache.jasper.JasperException: Unable to open taglibrary /hello : Parse Error in the tag library descriptor: Element type "web-app" is not declared.
at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java, Compiled Code)
at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:116)
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java, Compiled Code)
at org.apache.jasper.compiler.Parser.parse(Parser.java, Compiled Code)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1034)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java, Compiled Code)
at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:413)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:149)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:161)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:868)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Thread.java:479)
____________________________________________________
i tried alot to find out my mistake but i couldn't .
please help me
thanks
sumana

23 years ago