A msg box is displayed when textfield is empty or wrong entry

i put textfield in matrix on a frame know i want that when i press enter then a msg box is displayed if any text field is empty or wrong entry for example i just want to enter integer in text field i tried the following one but if i press enter without putting any entry or wrong entry it generate exceptions
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class NumericVerifier
public static void main(String args[])
JFrame frame = new JFrame("Numeric Verifier");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel1 = new JPanel(new BorderLayout());
JLabel label1 = new JLabel("Numeric-only");
JTextField textField1 = new JTextField();
panel1.add(label1, BorderLayout.WEST);
panel1.add(textField1, BorderLayout.CENTER);
JPanel panel3 = new JPanel(new BorderLayout());
JLabel label3 = new JLabel("Numeric-only");
JTextField textField3 = new JTextField();
panel3.add(label3, BorderLayout.WEST);
panel3.add(textField3, BorderLayout.CENTER);
InputVerifier verifier = new InputVerifier()
public boolean verify(JComponent comp)
boolean returnValue;
JTextField textField = (JTextField)comp;
try
Integer.parseInt(textField.getText());
returnValue = true;
} catch (NumberFormatException e)
returnValue = false;
return returnValue;
textField1.setInputVerifier(verifier);
textField3.setInputVerifier(verifier);
frame.add(panel1, BorderLayout.NORTH);
//frame.add(panel2, BorderLayout.CENTER);
frame.add(panel3, BorderLayout.SOUTH);
frame.setSize(300, 95);
frame.setVisible(true);
}

thanx for ur answer but i think u donot understand i know how to display msg box i just want tha when i press enter then a msg box is displaayed that u leave a textfield empty or wrong entry
i store the text fields in a multidimentional array

Similar Messages

  • Msg must be displayed when mismatch occurs

    Hi.,
    I am using jdev 11.1.1.5
    I had created Glhd,GLln EO's with corresponding VO's
    I had also created an transient attribute in GLln listed below
    Debitamt object.getRowset.sum("GLln.GjlDebitAmt")
    creditamt object.getRowset.sum("GLln.GjlCreditAmt")
    I had also created a viewlink
    Glhd.bu = GLln.bu
    I had dragged and dropped GLhd as adf:Forms GlLn as adf:table
    My Scenario:
    I need to display a msg if there is an mismatch in the values of Debitamt and creditamt

    one suggestion is to create a before phase Listener and display the message in the before render phase.
    in your pagem select the view node from the structure window, select BeforePhase attribute and create your own method
        public void beforeRender(PhaseEvent phaseEvent) {
            // check your condition, if true show the message
            int RENDER_RESPONSE = PhaseId.RENDER_RESPONSE.getOrdinal();
            if (phaseEvent.getPhaseId().getOrdinal()== RENDER_RESPONSE) {
                String messageText = "Add your message text";
                FacesMessage fm = new FacesMessage(messageText);
                fm.setSeverity(FacesMessage.SEVERITY_INFO);
                FacesContext context = FacesContext.getCurrentInstance();
                context.addMessage(null, fm);
            }Edited by: M.Jabr on Oct 21, 2011 1:00 PM

  • Icons for apps are not being displayed when I open the App store, just getting gray color boxes

    Icons for apps are not being displayed when I open the App store, just getting gray color boxes

    Did you update your operating system?  If so, did it solve the problem?  I have not updated my OS because so many people complained that the newer Os's had problems.

  • The dialog box open twice when open file from the server

    I use the following code to download/open file from the server:
    <%
    String filename = "MengxianhuiDocTest.doc";
    String filepath = "D:\\";
    response.setContentType("APPLICATION/OCTET-STREAM");
    response.setHeader("Content-Disposition",
    ??attachment; filename=\"" + filename + "\"");
    java.io.FileInputStream fileInputStream =
    new java.io.FileInputStream(filepath + filename);
    int i;
    while ((i=fileInputStream.read()) != -1) {
    out.write(i);
    fileInputStream.close();
    out.close();
    %>
    If the application runs, the Open or Save dialog box display.When I select open the file,
    the dialog box will display twice.
    Pls help me.
    Thanks.

    thx
    but I tried it and it did't work.
    The dialog box also display twice.

  • Premiere elements 12, new installation, serial no. accepted, installation completed and new started, but does not run. I get following msg-box: "LoadLibrary failed with error 126: Das angegebene Modul wurde nicht gefunden."

    premiere elements 12, new installation, serial no. accepted, installation completed and new started, but does not run. I get following msg-box: "LoadLibrary failed with error 126: Das angegebene Modul wurde nicht gefunden."   Installation in German Language on WIN7 professional 64bit, Samsung SSD. What can I do to run that program?

    Jurgen Freund
    Premiere Elements 12 on Window 7 64 bit. What video card/graphics card does your computer use - AMD Radeon?
    I have found this YouTube video on the subject of Error 126 with details for resolving the problem.
    How to fix the ERROR 126 when you open OpenGL programs - YouTube
    The link was contributed in an old 2013 thread here by the ID danneomarre (see post 6 of the following thread)
    LoadLibrary failed with error 126: cant find the required
    Please let us know if that worked for you.
    Thank you.
    ATR
    Add On...When all is OK and working, please update 12 to 12.1 Update using an opened project's Help Menu/Update.

  • My edited photos will not display when clicked on, a large triangle with exclmation comes up

    my edited photos will not display when clicked on, instead a large grey area comes up wiht a triangle /exclamation sign. 

    Try these in order - from best option on down...
    1. Do you have an up-to-date back up? If so, try copy the library6.iphoto file from the back up to the iPhoto Library (Right Click -> Show Package Contents) allowing it to overwrite the damaged file.
    2. Download <a href="http://www.fatcatsoftware.com/iplm/"><b><u>iPhoto Library Manager</b></u></a> and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.
    3. If neither of these work then you'll need to create and populate a new library.
    To create and populate a new *iPhoto 08* library:
    Note this will give you a working library with the same Events and pictures as before, however, you will lose your albums, keywords, modified versions, books, calendars etc.
    In the iPhoto Preferences -> Events Uncheck the box at 'Imported Items from the Finder'
    Move the iPhoto Library to the desktop
    Launch iPhoto. It will ask if you wish to create a new Library. Say Yes.
    Go into the iPhoto Library (Right Click -> Show Package Contents) on your desktop and find the Originals folder. From the Originals folder drag the individual Event Folders to the iPhoto Window and it will recreate them in the new library.
    When you're sure all is well you can delete the iPhoto Library on your desktop.
    In the future, in addition to your usual back up routine, you might like to make a copy of the library6.iPhoto file whenever you have made changes to the library as protection against database corruption. 

  • New topics are compiled in but don't display when help button is pressed

    Folks,
    I'm using RoboHelp HTML Build 6. I am the only writer who uses RH and have been using this build for 2 years or so.
    I recently got a new map file from the developer containing 2 new map IDs. I used the same steps to import the map file, create the new topics, and map them to the new map IDs that I have been using for years. But when I compiled RH and pasted the chm into the application folder, those 2 new topics don't display when the help button is clicked on the dialog box to which they are mapped.
    When I generate the chm I can look at the output at the bottom of RH project view and see that that the 2 new htm files are being compiled into the RH project. I can also see them if I open the generated chm and go into the TOC and click on a link to them.
    Does anyone have any ideas? I have tried redoing the usual procedure (see below) for the importing and mapping from scratch several times. I have also tried BugHunter (see below).
    Procedure for Importing and Mapping (this time the help for all the older dialog boxes works but not for the 2 new ones)
    1. Open the new map (.hm) file from the developer and add #define followed by a space to each entry beginnng with the string HID in the new map file (I don't know why but nothing works unless I do this.)
    2. Delete the old map file from the RH project.
    3. In Windows Explorer, copy the new .hm file into the RH project folder.
    4.In Project Manager view, open Context-Sensitive Help. Right-click on Map Files. Select Import. Browse and select the new map file.
    6. Map the new topics using File, Edit Map IDs.
    7. Generate the .chm and pasted it into the application where it always goes.
    BugHunter Procedures and Results
    I first tried the Test HTML Help API dialog.
    I specified the .CHM file I compiled and tested both options:
    --HH_DISPLAY_TOPIC: I put in the name of the new help (htm) file and its relative path and clicked Help. Nothing happened.
    --HH_HELP_CONTEXT: I put in the Map Number for the new dialog box and clicked Help. The new help topic I had created displayed.
    I also used the Tools tab in BugHunter to do a CSH (context sensitive help) Test. I identified the chm file and opened it and put in a new map number, then clicked Show Help. Nothing happened.

    Welcome to the RH forums.
    On the surface it sounds like you have done everything correctly so it should just be a case of going back and double checking that you have the correct CHM, that the mapid is exactly the same as in the app and that the app has been updated.
    Read the RoboColum(n) for a tips, tricks and musings on the Technical Communication Suite products.
    Follow the RoboColum(n) on Twitter

  • Is it possible to hide the yellow box that appears when you scroll over any object in the form?

    Is it possible to hide the yellow box that appears when you scroll over any object in the form? This box contains the item name or caption.

    Hi,
    Under Tools ... Options ... Workspace, there is an option "Display Object Name Tool Tips While Pointing".
    Try clearing that.
    Bruce

  • Error -36 alert displays when connecting to a Windows server

    Hi All
    I am getting error -36 when I tried to copy any file or folder from windows server
    "Error -36 alert displays when connecting to a Windows server"
    Even the file info is zero KB, while from other MAC machine it is right size.

    You shouldn't get the same error when you are doing it from Terminal. The error should be a little different. I just did a test. Is this a Microsoft 2003 server, 2000 or NT4 you are connecting to? Your post isn't specific. Make sure the System Preferences:Network:Advanced:WINS tab is filled in with the domain you are connecting to next to the "Workgroup" name. The WINS server should already be filled in. Open the connect window with command K. Type domainname\username for the login and then the password. If you don't want to enter the domain each time you will need to add the domain in the Applications:Utilities:Directory Uitility application.
    If you are trying to connect to a Windows XP client box, the machine will automatically try to authenticate with the guest account not the username and password you are using even when "registered user" is ticked. You have to edit the registry to change this default. If the username from the Windows PC is the same as the user logon then this is why the PC is able to connect and the mac is not.

  • OSStatus error -19000 isi displayed when trying to open .wmv file

    Hi,
    I am unable to open this .wmv file with any application I have including QT X, QT 7, WMV player4mac, or VLC. The following message is displayed when trying to open with QT: OSStatus error -19000. Can anyone help on how to open this file, and/or what the error msg means. thanks heaps.

    Welcome to the forums!
    Download and install the free Flip4Mac WMV Player from http://www.telestream.net/flip4mac-wmv/overview.htm (Windows Media Player for the Mac is no longer supported, even by Microsoft)

  • Stop Master Password popup on hidden login box? (display:none)

    I have a hidden login box on my website using "display:none" CSS and slides out using jquery, but Firefox shows the master password (Password Required) popup when it's hidden.
    Is there a way to only show the pop-up when they have clicked the button? It's a bit like the mozilla logo in the top-right.

    Hi, Welcome to Apple Discussions,
    See if this thread topic helps you, Keychain box comes up when Safari...
    Good Luck, post back & let us know if this helps or not.
    Eme'~[)

  • Runtime Error displayed when attempting to access Forums

    I've IE 9 installed on a Windows Home Premium box. When I attempt to access the Technet Forums the following is displayed
    Server Error in '/Forums' Application.
    Runtime Error
    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
    <!-- Web.Config Configuration File -->
    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>
    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
    <!-- Web.Config Configuration File -->
    <configuration>
    <system.web>
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
    </configuration>
    I'm running IE 9 on another PC (Windows 7 Pro) and it is able to acess the Technet Forums with no problem (I'm using it to make this entry).
    I've compared the settings on both browsers and they are identical. Why does IE on my Home Premium PC misbehave?
    Thanks in advance.

    Hi,
    What’s the result of other webpages?
    Can you access the thread link successfully?
    http://social.technet.microsoft.com/Forums/en-US/0c79aae9-3883-450a-bcd2-ba14ac5c8cd9/runtime-error-displayed-when-attempting-to-access-forums?forum=i
    You can test in compatible view for a try first.
    http://windows.microsoft.com/en-IN/internet-explorer/use-compatibility-view#ie=ie-9
    Alex Zhao
    TechNet Community Support

  • Display JOptionPane dialob box is displayed in the corners of the screen

    Hi,
    Iam using JOptionPane to display warning messages and error messages in the application.When i started testing my application in Win 98 and Windows XP the JOptionPane Dialog box is displayed in the bottom corners of the screen.is it possible to display the JOptionPane window in a particular position by setting the cordinates?
    Anyone has any idea?
    Pls Reply,
    Ravi

    If you use the "show" methods to display one of the default dialogs, providing a component should center the dialog on that component if it is visible.
    If you are constructing a JOptionPane, you can use setLocationRelativeTo to center the dialog on a component or your app.
    Or if you really want to play with raw numbers, use setLocation

  • Calling Msg-Box on condition with jQuery/Javascript

    Hello experts! I am stuck with my development as I don't know how to write the jQuery code.
    I want to call a message box (in fact an invisble DIV) when the value of my page item "P2008_MX_MODE" equals one.
    I have the following code for the message box but do not know how to add the conditional display when my page loads.
    Can you please help me on this?
    <script type="text/javascript">
    $(function()
    {$("#dialog").dialog({
                   autoOpen: false,
                            bgiframe: true,
                   modal: true,
                   buttons:
    {Schliessen: function(){$(this).dialog('close'); }}
         </script>
    <div id="dialog" title="Attention!">
    <p>
    <span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 30px 0;"></span>According to the official guidelines the evaluation for this area needs to be carried out manually!</p>
    </div>I appreciate any help and effort!
    Regards,
    Seb

    Hello Jari!
    I set it with a query!
    I am currently experimenting with a process after page load that is supposed to call the message box when cnumber is <> 0. It's basically the same as my page item P2008_MX_MODE.
    Nevertheless, my procedure is not working yet. Don't know how to call the jQuery function if my condition is true!
    declare
    cnumber number;
    begin
    Select distinct count(*) into cnumber from vt_punktdaten_join where STR_LRT_MAIN in ('9133','9132','9134','9181','9182','9183','9184','9185','91E3','91E4','91E5','91E6','91E7','91E8','91E9','9411','9412','9413','9414','9415','9416','9170') and cnt_gebiet = :p2008_cnt_GEBIET
    and int_status_sub = 3 and (str_lrt_main = :p2008_str_lrt) and (INT_BE_MAIN) = :p2008_BE;
    If cnumber != 0 then
    javascript:$('#dialog').dialog('open');
    End if;
    end;If you have an idea, please let me know!
    Thanks so far!
    Seb

  • Hpcmpmgr.exe display when shutting down laptop

    I originally posted this question under operating systems and software and was advised to post it under "printers".  I am new to this site and forum and hope to get some advice on the above mentioned problem.  I have a photosmart printer all in one, hp officejet J6480 series, my laptop is a Toshiba Satelitte L300D windows XP.  The laptop was purchased new in December 2008 and the printer all-in-one in Feb 2009.  I installed the printer and everthing worked fine.  The other day when I turned off my laptop I received a message box stating "End program"...hpcmpmgr.exe cannot end...click "end now" to close this program.  The only changes made to my system were the usual updates by windows etc.  I am using a USB hub and have this printer, speakers, and mouse pointer plugged into it.  Since my first post I have tried clicking on the "remove hardware" icon on the toolbar on the bottom right corner and selecting the device to remove it properly but I still get the same display when I turn off my laptop.  I would appreciate any suggestions on proper shut down technique to avoid this display.  Thank you. 

    Hi, thank you for your answer!
    I was truly troubled about this issue because it was a 'clean' pre-installed system and I didn't do anything to it.
    But it's good to hear, that I'm actually the only one having this kind of problem with Toshiba's new 550D.
    Anyways: *It seems that I somehow managed to solve this csc-issue by uninstalling Microsoft Essentials and all its components with a removal tool.*
    I'd be lucky if I'd found the culprit causing those error messages - if not, I'll try this csc.exe fix tool you just recommended.
    Thanks again!

Maybe you are looking for

  • XSD validation: wrong behaviour for mixed=false

    Based on XSD report.xsd demo file, I experienced mixed="false" attribute of complex type. <element name="purchaseReport"> <complexType mixed="false"> Such an attribute forbids text nodes in purchaseReport elements. So such XML data should be rejected

  • UAG/RDS RemoteApps not authorised for?

    Hi all, We have setup a UAG as gateway in front of RDS 2012. We published Remote Desktops and RemoteApps using a tspub file. I can succesfully logon to UAG and also open published Remote Desktops. The problem is with RemoteApps. When i try to open it

  • Change plug to interface controller in Netweaver 7.1

    hi ,          We are moving to Netweaver 7.1 . Current my webdynpro application is hvng plug firing through interface controller . I hv read tht in 7.1 interface controller is abstract so tht we cnt fire plug from interface controller. I want to know

  • 5.1 AC3 downmixing to stereo

    Hi, I am currently working on a workflow to create my own AVCHD discs (Blu-Ray on a DVD-R) from my Sony SR11 without editing or transcoding in Premiere. I import the files directly into Encore after demuxing them using tsMuxer (I need to demux them f

  • ALE- BD97

    Hi,   In ALE, Transaction code BD97 gets populated when we generate the Model or do we need to configure manually? Thanks in advance, Raja T