Yogesh Lonkar wrote:1. Change your method name getServiceDetails , try not to use get*** in action method as many times it is found that they are called twice if result type is json.
2. Your are using result type json in wrong manner <result name="success" type="json">/jsp/PatientData.jsp</result> you can not treat it as a type dispatcher.refer this link Struts2-json-plugin-docs
Ranganathan Kaliyur Mannar wrote:This has nothing to do with Swing. Moving this to the Struts forum.
Michael Dunn wrote:paintComponent is called numerous times, for numerous reasons, and you don't want to stop it.
sounds more like there's a problem in your code.
Michael Dunn wrote:the component in the scrolllPane needs to have a preferredSize larger than the scrollPane.
as your CustomPanel has no components, its preferredSize will be 0,0
add a constructor to CustomPanel
where 800,600 is anything you want
Michael Dunn wrote:Darryl's reply explains the drawing bit.
Do you need it in braille?
Darryl Burke wrote:Have you really never referred to the API?
Michael Dunn wrote:> I want to draw hexagons and also want to add scrollpane in window
please enlighten us as to what part of Darryl's reply you cannot understand.
Darryl Burke wrote:1. Why are you using AWT? Swing's been around for more than 10 years now.
2. If you must use AWT, check out the API for ScrollPane.
3. Better, use Swing and follow the links to relevant tutorial from the API for JScrollPane. Also, change your code to do custom painting in an extended JPanel or JComponent, following the guidelines in the tutorial on Performing Custom Painting, and respect Swing's single threaded rule, for which refer to the tutorial on Concurrency in Swing. And don't use getGraphics() of a component.