Problem in using FilenameFilter with FileDialog

perhaps, i dont know how to use FilenameFilter with FileDialog because the following approach doesn' work
FileDialog fd=new FileDialog(myframe,"Select an image");
fd.setFilenameFilter(new filefilter());                                                                                                                           
                                                                                                         class filefilter implements FilenameFilter{
    public boolean accept(File dir, String name) {
        if(name.endsWith("jpg")||name.endsWith("gif")||name.endsWith("png")){
                      return true; 
             return false;
}if anyone have compatible idea then please let me know.
thanks

Did you print out the value of "dir" and "name" to make sure they contain what you expect?
If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)", that demonstrates the incorrect behaviour.
http://homepage1.nifty.com/algafield/sscce.html

Similar Messages

  • Navigation problem when using tiles with JSF

    Hi all,
    I m using tiles with JSF. i have included all the libraries and jsp page is rendered properly. but when i use <h:commandLink> in the body part of the JSP , i cannot go to the specified link. when we use tiles, what changes need to be done in faces-config file?? i mean what navigation rule we need to specify ??

    Hello, I have the same problem; JSF+Tiles = No navigation.
    One basic question is should I reference the parent jsp or the included body jsp in the faces-config.xml file.
    For example: The login.jsp is a main tiles page that includes a menu.jsp, header.jsp & a loginBody.jsp.
    Hence the faces-config could have this rule;
    <navigation-rule>
    <from-view-id>/login.jsp</from-view-id>
    <navigation-case>
    <to-view-id>/catalog.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    (I've left the outcome tag out to simplify this post)
    Or, I could refer loginBody.jsp in the navigation rule;
    <navigation-rule>
    <from-view-id>/loginBody.jsp</from-view-id>
    <navigation-case>
    <to-view-id>/catalog.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    The loginBody.jsp has a commandbutton which a user clicks which starts the navigation.
    Neither seems to work unfortunately & I'm a stuck.
    Thanks

  • Problem while using XML with Oracle

    I have a problem using XML with oracle applications
    The process I am following
    1. Making a XML string.
    2. Parsing it to get a document
    3. Free the parser using xmlparser.freeparser
    4. Traversing through nodes .
    5. Freeing the document.
    The whole Process is executed in batch mode.
    The problem occurs after executing the procedure for 5000 records and I get the error
    ORA-04031: unable to allocate 4176 bytes of shared memory ("shared pool","unknown object","sga
    heap","library cache")
    Can you please help me out to overcome this problem
    It's urgent
    I have
    Oracle version 8.1.7.0.0
    XML version 1.2
    OS Windows NT
    To resolve the problem I have increase shared memory size and java initialization parameters ,which seems OK
    Looking forward for your answer.

    Hello, Reena
    Your process flow seems to be correct in term of getting/freeing memory.
    Following error
    The problem occurs after executing the procedure for 5000 records and I get the error
    ORA-04031: unable to allocate 4176 bytes of shared memory ("shared pool","unknown object","sga
    heap","library cache")may be caused by memory leaks in xdk or memory fragmentation(due to get/free memory cycle)
    To find out if this is an memory leak issue you could try to monitor V$SGASTAT from one session while running your batch process in another session.
    To prevent (or lower its impact) fragmentation issues try to PIN objects, and adjust java_pool_size and shared_pool_reserved_size.
    Anyway, counsult your Oracle DBA.
    Oracle version 8.1.7.0.0I think, you should apply database patch first of all. The latest one (8.1.7.4.x) could be accured from Metalink.

  • Problems tethering using wifi with Twist laptop and iphone

    Hello,
    I have a Twist and works fine, although I have recently moved to an iphone 6.  The phone and laptop combination has problem tethering over wifi, with tethering enabled on the phone, the laptop does not find the wifi signal.  Asking a colleague to see if my phone is broadcasting an SSID, which it was.  The laptop just doesn't want to find my iphone wifi signal.  However, finding any wifi broadcast from a router, it finds it first time!
    Since it was a new phone, I have been speaking with apple a lot and have even replaced the iphone, although problems still persist.
    I am starting to think it is the lenovo twist laptop.  I have checked the drivers and I have the latest ones which are on the lenovo website because the program used to update the software doesn't ask me to install a new driver, but looking at the wifi driver within the device manager it is dated: 13/08/2012. with driver version #: 6.20.55.55.
    I have the 2x2 11a/b/g/n Wireless LAN PCI Express Half Mini Card Adapter and is based on the Broadcom chipset.
    Do any of you have this problem?  Also, where can I obtain the very latest driver for this as I would suspect it is likely to be a driver issue or I would like to rule this out first.
    Many thanks.
    Solved!
    Go to Solution.

    Thanks for the progress report.
    If things remaIn stable, please do come back and mark you post as the solution. It may help other members.
    Thanks.
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество
    Community Resources: Participation Rules • Images in posts • Search (Advanced) • Private Messaging
    PM requests for individual support are not answered. If a post solves your issue, please mark it so.
    X1C3 Helix X220 X301 X200T T61p T60p Y3P • T520 T420 T510 T400 R400 T61 Y2P Y13
    I am not a Lenovo employee.

  • Problems in using Msync with  IPAQ 3760 and Active SYnc 3.5

    Hi,
    Environment :-
    IPAQ 3760
    Windows NT workstation
    Active Sync 3.5
    I am using Active Sync 3.5 which does not need RAS
    configuration on the machine.
    I am unable to run msync.exe. It does not give any errors
    messages.
    The 9i lite documentation talks about RAS settings.
    If anyone has faced similar prob coudl you please let me know
    the solution.
    regards,
    Sonal

    You do not need to make a RAS connection with Pocket PC 2002,
    because now ActiveSync itself makes an IP connection, and
    Oracle9i Lite just needs an IP connection for synchronization no
    matter how you establish it. Hi, I also experience the same problem. Using PocketPC 2002 I have a pasthru connection. Ik kan browse on the Internet with Internet Explorer, so the connections works.
    mSync just seems to do nothing. When I press the Sync button, nothing happens (not even a progress bar).
    Any idea?
    Thanks,
    Bas.

  • Problem in Using Log4J with Weblogic 9.2

    I am using Weblogic 9.2 and Log4j.
    By using Admin console I set the Severity Level to WARNING and inside my java code is given below:
    Logger logger = Log4jLoggingHelper.getLog4jServerLogger();
    if (logger.isEnabledFor(Priority.DEBUG)){
    logger.debug("DEBUG - Test Debug message");
    logger.info("DEBUG - Test Info Message");
    logger.warn("DEBUG - Test Warning Message");
    logger.error("DEBUG - Test Error Message");
    logger.fatal("DEBUG - Test Fatal Message");          
    Somehow the logger.isEnabledFor(Priority.DEBUG) returning 'TRUE' and the follwoing message is displayed.
    <Nov 29, 2006 2:44:04 PM EST> <Warning> org.apache.log4j.Category> <000000> <DEBUG - Test Warning Message>
    <Nov 29, 2006 2:44:04 PM EST> <Error> <org.apache.log4j.Category> <000000> <DEBUG - Test Error Message>
    <Nov 29, 2006 2:44:04 PM EST> <Info> <org.apache.log4j.Category> <000000> <DEBUG - Test Fatal Message>
    <b><i>NOTE - The logger.debug() and logger.info() methods are not invoked because of the severity level to 'WARNING' in the console.</i></b>
    <b>I would like to know why the Somehow the logger.isEnabledFor(Priority.DEBUG) is having a value of 'TRUE'.</b>
    I expected only the Somehow the logger.isEnabledFor(Priority.ERROR) will have the value of 'TRUE'.

    Did you get an answer to your question? I have the same problem with WebLogic 10.0.

  • Problem in using createStatement with parameters

    Hi,
    I have a peculiar problem using JDBC-ODBC bridge driver. With this driver I am able to make a connection to the database (Oracle/SQL Server/MS-Access). But when I try to create a statement using the connection, I get an error. The code written by me is below :-
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn = DriverManager.getConnection("jdbc:odbc:tsvt","sa","");
    Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    If I use this constructor fo createStament, I get the following Runtime Exception
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented
    java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented
         at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6031)
         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188)
         at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:2494)
         at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:314)
         at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(JdbcOdbcStatement.java:229)
         at accs2oracl.<init>(accs2oracl.java:39)
         at accs2oracl.main(accs2oracl.java:166)
    If I use just conn.createStatement(), I dont get any error.
    Some one help me out where I am going wrong

    Some - or most? - ODBC driver, especially MS for SQLServer and Access, don't support these advanced JDBC features.
    Like the messages says: they are optional features, and the driver doesn't implement them.
    A good news:
    you don't need them.
    Just go through your ResultSets only forward by next(), and do all inserts, updates and deletes with executeUpdate() and SQL commands.

  • Problem in using 6670 with T-Mobile.. need urgent ...

    hiya there
    ive got a strange problem with my 6670
    the problem is specifically with using T-Mobile uk
    when i put my T-Mobile sim in the phone i can make phone calls and recieve txts but it just only recieve phone calls from the same network i.e T-Mobile not from even landline the message ppl get is "the phone is currently unavailable" it dont even go to the voice mail.
    on the other hand if i put my orange sim the phone work totally normal i can make calls and i can recieve calls from any network or landlines.
    i have tried alot of ppl even car phone warehouse but they said they will charge 100£ which i cant afford
    so if somebody can help me out in this situation
    ill be grateful
    cheers
    chekoo

    Since you said it works fine with an Orange SIM card, it sounds more like it's a network issue than a handset issue. I'd give T-Mobile a call and see what they can do for you - Your SIM may have call barring setup.
    Aubs
    Aubs

  • NIO: Strange problem when using ByteBuffer with non-blocking SocketChannel

    Hi,
    I have a server that uses multiplexed, non-blocking I/O with java.nio. When a client connects, the server waits for the message: <system cmd="knock"/>, returns a message and disconnects the client. The clients are shortly serviced in less than a second.
    But the server newer receive anything from about 20% of the clients - even though it is sent. Or with other words: it is received and the data is contained in the ByteBuffer - SocketChannel.read(ByteBuffer) - but a call to ByteBuffer.remaing() returns 0 !!
    ByteBuffer receiveBuf = ByteBuffer.allocate(65536);
    receiveBuf.clear(); // the code is elsewhere used for longer living clients
    int readBytes = channel.read(receiveBuf);
    receiveBuf.flip();
    StringBuffer sb = new StringBuffer();
    System.out.println(" * Remaining: "+receiveBuf.remaining()); // writes: ' * Remaining: 0'
    System.out.println(" * Received: "+new String(receiveBuf.array())); // writes: ' * Received: <system cmd="knock"/>'
    while(receiveBuf.remaining() >= 2) {
      byte b = receiveBuf.get();
      sb.append((char)b);
    System.out.println(" * sb content: "+sb.toString()); // writes: ' * sb content: 'The ByteBuffer clearly receives the correct data, but the ByteBuffer.remaining() returns 0 and therefore the StringBuffer will never have any content.
    The problem seems to occur randomly and for about 20% of the clients (simulated from the same computer and therefore has the same bandwidth and so on).
    Anyone knows what is going on, and how to solve the problem !?

    It's always possible in any read that the number of bytes read is less than the number of bytes requested. You need to keep reading until you have got everything you expected, and cope with every possible error condition on each iteration.
    EJP

  • Problem in Using  Oracle with Thin Clients(Image) Technology

    I am running Oracle on Server and mine clients are thin clients.I have image on Oracle Server from where I am booting thin clients.The Problem I am facing is when I use single Thin client then everything works but as I starts using more than one thin client mine I got the error rwrun60 and it gives the that close or ignore message.I am using run_product for running reports.Then I tried to use run_report_object but how can I pass paramater using run_report_objects

    i m not getting much from what you are saying.... but i found something.i created a windows application and then was able to create a dataset from ODAC connection to oracle. then dragging the dataset on windows form... i was able to create a data grid containing the data. hittin F5 the app was running successfull. however when tryin to do same in asp.net...when configuring the data source using sql datasource it gave me following error ...
    ORA-00942: table or view does not exist
    help help

  • Problem in using DOMAdapter with xslt

    I have created one .xslt file for transforming one XML to another XML. I am using api's like xerces-2_7_1,xalan-j_2_7_1 from Apache.
    In side my xslt I have taken variable(for sample) like:
    <xsl:variable name="MyVar">
      <Nodes>
        <Node>
          <xsl:attribute name="type">TypeOne</xsl:attribute>
          <Value>This is first node.</Value>
         </Node>
         <Node>
           <xsl:attribute name="type">TypeTwo</xsl:attribute>
           <Value>This is second node.</Value>
         </Node>
         <Node>
           <xsl:attribute name="type">TypeThree</xsl:attribute>
           <Value>This is Third node.</Value>
         </Node>
      </Nodes>
    </xsl:variable>
    <xsl:for-each select="myextension:testMethod ($MyVar)">
         <!-- My Code on selected object.-->
    </xsl:for-each>I want to access this variable in my XSLTExtension class which is a simple java class. I have called method of this class with select="myextension:testMethod ($MyVar)" above.
    I am getting variable in XSLTExtension file and even got all values of it.
    I written code in java file like:
    import com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    public static DOMAdapter testMethod (Object adapter){
            DOMAdapter domAdapter = (DOMAdapter) adapter;
            Node nodes = domAdapter.makeNode (domAdapter.getIterator ());
            NodeList list = nodes.getChildNodes ();
                   Code for getting values form NodeList which is quite simple.
                   Processing those values with my business logic and
                   creating new Document to be returned as DOMAdapter.
    }As I mentioned in method I want to return DOMAdapter from method to calling XSLT file. How can I do this?
    if any one have any Idea then please tell me. Any comment regarding this will help me.
    Thanks in Advance,
    TYPurohit.

    Since you said it works fine with an Orange SIM card, it sounds more like it's a network issue than a handset issue. I'd give T-Mobile a call and see what they can do for you - Your SIM may have call barring setup.
    Aubs
    Aubs

  • URGENT -- Problem in using JMS with JBOSS

    Hi,
    My jar file which includes my Java/JMS classes can easily be executed when I use Sun Application server, but I don't know how I can change execute the same jar file in when I switch to JBOSS. Do I need to use ants? or I can use the original jar files?
    thanks,

    It can depends on your application, but basically in order to run JMS JBoss client application you need:
    1) Set proper jndi settings, e.g. by placing jndi.properties to the root of your classpath.
    2) Add some jars to your classpath from client folder of your jboss AS distribution. My latest application works well with concurrent.jar, jnp-client.jar and jbossall-client.jar on the classpath.
    You can read more at http://docs.jboss.org/jbossas/guides/j2eeguide/r2/en/html/ch6.chapt.html It is valid for all the 4.x jboss versions. Check jboss samples also.
    Best Regards,
    Roman

  • Problem in using sum with distinct in case

    Hi all,
    I want to use a sum function with distinct and also with case.
    below is the format i am using.
    Sum( distinct case when a.value='TOOL' then e.value else 0 end)
    This is working but i don't get distinct records.
    SO i tried using in this way
    Sum( case when a.value='TOOL' then distinct e.value else 0 end)
    But I am getting missing expression error.
    Please help me to resolve this issue
    Thanks
    Priya

    STEP -2
    SQL>
    SQL> commit;
    Commit complete.
    SQL> ed
    Wrote file afiedt.buf
      1  Select Sum(Value)
      2  From (
      3          Select Distinct Case when value='TOOL'
      4                               then value
      5                          else
      6                              0
      7                          end Value
      8          From Blah
      9*      )
    SQL> /
                                0
    ERROR at line 6:
    ORA-00932: inconsistent datatypes: expected CHAR got NUMBERRegards.
    Satyaki De.

  • Problem in using TreeSet with a Comparator

    Hello,
    There seems to be a bug in the implementation of TreeSet, while using a specific Comparator to sort its elements.
    Here's the problem I got into: the Comparator I use has a type parameter which defines, of course, the type of objects that may be compared. These objects have an integer field 'value'. In the redefinition of 'compare' method inside the Comparator, if the values are equal, 0 is returned, otherwise returns -1 or 1.
    Now, I want to add objects into my TreeSet having this Comparator. But, when I call add for an object that has the field 'value' equal to a value from an object that is already in the Tree Set, it doesn't add it. I red the API documentation, which says that a non-null object o1 is not added into the tree set if there is already an object o2 such that o1.equals(o2) returns true. Or, my objects are far from being equal: the references are different, there are even some fields different.
    Nevertheless, all my elements are comparable.
    Am I ignoring something or is there a bug?
    Thanks.

    When I call add for an object that has the field 'value' equal to a value from an object that is already in the Tree Set, it doesn't add it.Correct. That's how it is supposed to behave. A Set cannot contain duplicates.
    I read the API documentationEvidently not all of it ;-)

  • Problem in using MDB with Foregin Server

    Hi, anyone can help me? I am currently using Weblogic 11g, 10.3.5, development edition locally in my desktop.
    My scenario is I have to using an MDB to monitor a queue in a Tibco EMS queue (lookup with LDAP server).
    I create a JMS Server, and a JMS module with a Foreign Server configured. In the module, I specified "JNDI Initial Connection Factory", "JNDI Connection URL", "JNDI Credentirals", etc.
    In the module, I have a Queue with local jndi name: jms/MyReqQueue and a Connection Factory, jms/MyReqCF (with password setup).
    I created an MDB with annotations, and packaged into a EAR
    @MessageDestinationConfiguration(connectionFactoryJNDIName = "jms/MyReqCF")
    @MessageDriven(
              activationConfig = {
                        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
                        @ActivationConfigProperty(propertyName = "connectionFactoryJndiName", propertyValue = "jms/MyReqQueue")
              mappedName = "jms/MyReqQueue")
    public class FortressOrderProcMDBean implements MessageListener {
    I created a testing program, which create an initial context, connection factory, queue myself to the weblogic server using my local jndi names, then i can receive mesages from the queue properly, so the JMS Foreign Server should work fine.
    However, I got the foilowing error withn deploying the MDB.
    [EJB:011012]The JMS connection factory with the JNDI name: weblogic.jms.MessageDrivenBeanConnectionFactory could not be found. Please ensure that the JNDI name
    in the weblogic-ejb-jar.xml or corresponding annotation is correct, and the JMSconnection factory has been deployed.
    javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'ou=weblogic.jms.MessageDrivenBeanConnectionFactory' NestedException
    Message is :[LDAP: error code 32 - No Such Object]>
    Thanks

    Your annotated MDB does not seem to be correct. The error indicates that the connection factory jndi name of the MDB was not set correctly.
    Please refer to the following doc for an sample.
    http://download.oracle.com/docs/cd/E17904_01/web.1111/e15493/annotations.htm#sthref25

Maybe you are looking for

  • Problem on display '�'

    when i try to display some special char, e.g '�' (ascii code 196 )in java it cannot display. The char is correctlly store in java. why cannot dispaly ?? could any one give my some idea ?

  • Problem with cancel billing document URGENT

    Hello, I have a problem. I have created cancel invoice but if you look at the document flow for tht cancel invoice it is showing completed and accounting document clreared. But client is asking that when ever we create cancel invoice this status shou

  • Input Help in BSP application

    Hi, I need to associate standard and custom input helps to a custom field in the standard BSP of Opportunity in the Details tab. I don't know nothing about this so where can I find some documentation? I want to understand the meaning of: Field Name -

  • Customizing Search for Tablet or Mobile only devices

    Hi BC Community, Quick question - I am building a website using an adaptive layout design and I want to be able to have a Search box in the Tablet device and the Mobile Device.  Is there a way of setting up the search functionality so that when you a

  • USB on ibook G4

    I bought my ibook G4 in May, and I am not sure if it has usb 1 or USB 2.0. Does anyone know when they started putting 2.0 on the ibook or how I can find out what I have? (it doesn't mention what version I have in my system profile). thanks!