kalpana s

Greenhorn
+ Follow
since Dec 22, 2003
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 kalpana s

i have used the same piece of code, but the key events are not getting triggered.
What could be the problem.
14 years ago
please just ignore the code which i have given
14 years ago
hi all,

i have a JList in my application. ihave set a definite size to the jlist.
suppose i have only 2 items on the jlist, the 2 list items will be filled only in top portion of the jlist
the remaining portion will be empty.

my problem is

when i click on the empty portion of the jlist, the last item on the jlist will get selected. i dont wnat this to happen. The item should be selected only when i clik on the jlist item not on the empty portion of the jlist.

how do i do this

The code which does the selection is as below

public class CustomCellRenderer implements ListCellRenderer
{
DefaultListCellRenderer listCellRenderer = new DefaultListCellRenderer();
public Component getListCellRendererComponent(
JList list, Object value, int index, boolean isSelected, boolean hasFocus)
{
Component component=null;
if(value!=null){
component= (Component)value;
component.setBackground (isSelected ? new Color(51, 0, 153) : new Color(204,204,204));
}
return component;
}
}


Thanks
kalpana
14 years ago
hi all,

i have a scaled down image on a jlabel. i hava a popup menu wiht a "preview"
menuitem. if i click on preview, i show be able to bring up mspaint.exe loaded with the image file - say a gif file using java.

how do i do this.

kalpana
14 years ago
hi bear,

i have changed my display name as per your suggestion and reposting the same question again

------------------------------------------------------------------------
i am creating a photouploader tool for Mac . i am using using java1.4.2 on Mac OS x.

i have a problem while pasting images on to the java application from Mac Systemclipboard

i am able to copy only one image file from the system clipboard and paste it on the java application. ie., the jList.

if i copy more than one image file into the system clipboard, the paste operation does not work.

i have this problem only when i run the application on mac os.
On windows i am able to paste any number of images on to the java application - it works fine!!!

i need help on this ... The code portion for the 'paste' operaton is below
=================================================================
1. Toolkit kit = Toolkit.getDefaultToolkit();
2. final Clipboard clipboard = kit.getSystemClipboard();
3. Transferable tr = clipboard.getContents(clipboard);
4. try{
5. java.util.List fileList = (java.util.List)tr.getTransferData(DataFlavor.javaFileListFlavor);
6. Iterator iterator = fileList.iterator();
7. while (iterator.hasNext())
8. {
9. File file = (File)iterator.next();
10. ((DefaultListModel)jList.getModel()).addElement(new JLabel(getImage(file)));
11. }
12. } catch(UnsupportedFlavorException no){ no.printStackTrace();}
13. catch(IOException io){io.printStackTrace();}
=================================================================
i get the following exception at line 4.. when i tried to paste 3 .gif files and works for one gif file

java.awt.datatransfer.UnsupportedFlavorException: application/x-java-file-list
at sun.awt.datatransfer.ClipboardTransferable.getTransferData(ClipboardTransferable.java:168)
at UploadPhotosPane.pasteActionPerformed(UploadPhotosPane.java:778)
at UploadPhotosPane$19.actionPerformed(UploadPhotosPane.java:553)



any help on this is highly appreciated,

Thanks in advance
kalpana
14 years ago
hi all

i need to set the state of the CAPS-LOCK key in the status bar of my application at startup.
i am using jdk1.4.2 for development on mac os x.

the existing Toolkit.getDefaultToolkit().getLockingKeyState() does not work on mac.

so how do i find the state of the key... on application startup.

thanks
kalpana
14 years ago
hi all,

i am creating a photouploader tool for Mac . i am using using java1.4.2 on Mac OS x.

i have a problem while pasting images on to the java application from Mac Systemclipboard

i am able to copy only one image file from the system clipboard and paste it on the java application. ie., the jList.

if i copy more than one image file into the system clipboard, the paste operation does not work.

i have this problem only when i run the application on mac os.
On windows i am able to paste any number of images on to the java application - it works fine!!!

i need help on this ... The code portion for the 'paste' operaton is below
=================================================================
1. Toolkit kit = Toolkit.getDefaultToolkit();
2. final Clipboard clipboard = kit.getSystemClipboard();
3. Transferable tr = clipboard.getContents(clipboard);
4. try{
5. java.util.List fileList = (java.util.List)tr.getTransferData(DataFlavor.javaFileListFlavor);
6. Iterator iterator = fileList.iterator();
7. while (iterator.hasNext())
8. {
9. File file = (File)iterator.next();
10. ((DefaultListModel)jList.getModel()).addElement(new JLabel(getImage(file)));
11. }
12. } catch(UnsupportedFlavorException no){ no.printStackTrace();}
13. catch(IOException io){io.printStackTrace();}
=================================================================
i get the following exception at line 4.. when i tried to paste 3 .gif files �and works for one gif file

java.awt.datatransfer.UnsupportedFlavorException: application/x-java-file-list
� � � � at sun.awt.datatransfer.ClipboardTransferable.getTransferData(ClipboardTransferable.java:168)
� � � � at UploadPhotosPane.pasteActionPerformed(UploadPhotosPane.java:778)
� � � � at UploadPhotosPane$19.actionPerformed(UploadPhotosPane.java:553)



any help on this is highly appreciated,
its urgents also

Thanks in advance
kalpana
14 years ago
hi all,

I have a struts based web application on tomcat 4.0.6.

I start tomcat4.0.6 manually using C:\jakarta-tomcat-4.0.6\bin\startup, the application comes up successfully

I have started tomcat4.0.6 as a windows 2k service and when i try to bring up the web application, i get a ServletException.

javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
at org.apache.jsp.logon$jsp._jspService(logon$jsp.java:257)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
.
.
root cause
javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:858)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:543)
at org.apache.jsp.logon$jsp._jspService(logon$jsp.java:94)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
.
.
Could any body tell me what may be the problem, i am getting this exception for the login page itself....
Its urgent
Thanks in advance
kalpana
15 years ago