Trapping KeyEvents

I've been approached by a student who wants to create a game that uses the keyboard from Swing. We've tried a couple of approaches already:
1) Making the JApplet itself the KeyListener (no effect)
2) Adding a KeyListener to glassPane (no effect)
     getContentPane().addKeyListener(new java.awt.event.KeyListener() {
               public void keyPressed (KeyEvent e)          {}
               public void keyReleased (KeyEvent e)     {}
               public void keyTyped (java.awt.event.KeyEvent e) {
                    keyTyped(e);
We're looking for a technique that will trap the KeyEvents for the whole window. Anyone know how to do this?

Here's the code:
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.Dimension;
public class KeyDemoApplet extends javax.swing.JApplet implements KeyListener{
JTextArea displayArea;
JTextField typingArea;
static final String newline = "\n";
public void init() {
typingArea = new JTextField(20);
typingArea.addKeyListener(this);
displayArea = new JTextArea();
displayArea.setEditable(false);
JScrollPane scrollPane = new JScrollPane(displayArea);
scrollPane.setPreferredSize(new Dimension(375, 125));
JPanel contentPane = new JPanel();
contentPane.setLayout(new BorderLayout());
contentPane.add(typingArea, BorderLayout.NORTH);
contentPane.add(scrollPane, BorderLayout.CENTER);
setContentPane(contentPane);
typingArea.requestFocus();
/** Handle the key typed event from the text field. */
public void keyTyped(KeyEvent e) {
switch (e.getKeyChar())     {
     case KeyEvent.VK_UP:     displayArea.append ("^"+newline); break;
     case KeyEvent.VK_DOWN:     displayArea.append ("V"+newline); break;
     case KeyEvent.VK_LEFT:     displayArea.append ("<"+newline); break;
     case KeyEvent.VK_RIGHT:     displayArea.append (">"+newline); break;
/** Handle the key pressed event from the text field. */
public void keyPressed(KeyEvent e) {}
/** Handle the key released event from the text field. */
public void keyReleased(KeyEvent e) {}
* We have to jump through some hoops to avoid
* trying to print non-printing characters
* such as Shift. (Not only do they not print,
* but if you put them in a String, the characters
* afterward won't show up in the text area.)
protected void displayInfo(KeyEvent e, String s){
String charString, keyCodeString, modString, tmpString;
char c = e.getKeyChar();
int keyCode = e.getKeyCode();
int modifiers = e.getModifiers();
if (Character.isISOControl(c)) {
charString = "key character = "
+ "(an unprintable control character)";
} else {
charString = "key character = '"
+ c + "'";
keyCodeString = "key code = " + keyCode
+ " ("
+ KeyEvent.getKeyText(keyCode)
+ ")";
modString = "modifiers = " + modifiers;
tmpString = KeyEvent.getKeyModifiersText(modifiers);
if (tmpString.length() > 0) {
modString += " (" + tmpString + ")";
} else {
modString += " (no modifiers)";
displayArea.append(s + newline
+ " " + charString + newline
+ " " + keyCodeString + newline
+ " " + modString + newline);

Similar Messages

  • Trapping KeyEvents anywhere in a JFrame for a status bar

    Hi all,
    There are a few examples of how to implement a status bar in the archives, but I haven't seen anything that tells you how to trap KeyEvents (e.g. pertaining to CapsLock etc.) which occur anywhere in a JFrame: once you start adding focusable components (particularly but not exclusively JTextComponents) to a JFrame the JFrame itself is often not sent the KeyEvents, so a rudimentary addKeyListener() is not the answer.
    Could this involve the use of KeyboardFocusManager or sthg? NB to experts: I have read the tutorial on the focus subsystem to no avail. The key seems to be to trap the event thread in some way, perhaps??
    All help greatly appreciated...
    Mike

    Add a AWTEventListener on Toolkit.getDefaultToolkit() with appropriate mask. See javadocs of addAWTEventListener method.

  • 1.4....trapping keyevents in JWindow.. V E R Y T O U G H...

    Hello JDevelopers....
    This is very tough for me..
    Could u pls write some lines of code for me..
    P L E A S E... !!!
    I have a JWindow... and I want to display "keypressed" on console when user press a key on that jwindow..
    It seems very simple but ...
    It is very Urgent...
    Thanks in advance.

    Not quite sue why you need a JWindow to use full screen mode:
    here's a screen saver (of sorts) that I wrote to use FSM which uses a JFrame (undecorated)
    first the main program:
    import java.awt.*;
    import javax.swing.*;
    public class FullScreenTest
        public static void main(String[] args)
            GraphicsDevice graphicsDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
            if(graphicsDevice.isFullScreenSupported())
                System.out.println("Full screen supported");
            else
                System.out.println("Full not screen supported");
                System.exit(0);
            try
                FullScreenWindow fullScreenWindow=new FullScreenWindow(graphicsDevice);
            catch(Exception e)
                e.printStackTrace();
    }now the full screen window
    import java.io.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.image.BufferStrategy;
    import java.awt.Graphics2D.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import com.sun.image.codec.jpeg.*;
    public class FullScreenWindow extends JFrame implements ImageObserver
        private GraphicsDevice m_graphicsDevice;
        private BufferStrategy m_bufferStrategy;
        private javax.swing.Timer m_timer;
        private int m_cx;
        private int m_cy;
        private AffineTransform m_identityTransform=new AffineTransform();
        private Graphics2D m_g2d;
        private File[] m_files;
        private int m_file=0;
        private Random m_random=new Random();
        private Image m_image;
        private boolean full=false;
        public FullScreenWindow(GraphicsDevice graphicsDevice)
            super(graphicsDevice.getDefaultConfiguration());
            m_graphicsDevice=graphicsDevice;
            setIgnoreRepaint(true);
            setUndecorated(true);
            m_graphicsDevice.setFullScreenWindow(this);
            m_cx=graphicsDevice.getDisplayMode().getWidth();
            m_cy=graphicsDevice.getDisplayMode().getHeight();
            this.addKeyListener(new java.awt.event.KeyAdapter()
                public void keyPressed(KeyEvent e)
                    doExit();
            this.addMouseMotionListener(new java.awt.event.MouseMotionListener()
                public void mouseMoved(MouseEvent e)
                    doExit();
                public void mouseDragged(MouseEvent e)
                    doExit();
            this.addMouseListener(new java.awt.event.MouseListener()
                public void mouseClicked(MouseEvent e)
                    doExit();
                public void mouseEntered(MouseEvent e)
                    doExit();
                public void mouseExited(MouseEvent e)
                    doExit();
                public void mousePressed(MouseEvent e)
                    doExit();
                public void mouseReleased(MouseEvent e)
                    doExit();
            m_timer=new javax.swing.Timer(3000,new java.awt.event.ActionListener()
                public void actionPerformed(ActionEvent e)
                    timerTick();
            createBufferStrategy(1);
            m_bufferStrategy=getBufferStrategy();
            m_g2d=(Graphics2D)m_bufferStrategy.getDrawGraphics();
            File file=new File(".");
            JPEGFileFilter filter=new JPEGFileFilter();
            m_files=file.listFiles(filter);
            fetchNextImage();
            displayImage();
            m_timer.start();
        void fetchNextImage()
            try
                File file=m_files[m_random.nextInt(m_files.length)];
                FileInputStream fileInputStream=new FileInputStream(file.getAbsolutePath());
                JPEGImageDecoder jpegImageDecoder=JPEGCodec.createJPEGDecoder(fileInputStream);
                BufferedImage image=jpegImageDecoder.decodeAsBufferedImage();
                if(image.getWidth()>image.getHeight())
                    m_image=image.getScaledInstance(m_cx,m_cy,Image.SCALE_SMOOTH);
                    full=true;
                else
                    m_image=image;
                    full=false;
            catch(Exception ex)
                ex.printStackTrace();
        public void timerTick()
            displayImage();
            fetchNextImage();
            requestFocusInWindow(true);
        void displayImage()
            int x=0;
            int y=0;
            if(!full)
                m_g2d.setColor(Color.black);
                m_g2d.fillRect(0,0,m_cx,m_cy);
                x=m_cx/2-m_image.getWidth(this)/2;
                y=m_cy/2-m_image.getHeight(this)/2;
            m_g2d.drawImage(m_image,x,y,this);
        public boolean imageUpdate(Image image,int infoFlags,int x,int y,int width,int height)
            if((infoFlags&ImageObserver.ALLBITS)!=0)
                m_image=null;
            return true;
        public void doExit()
            m_graphicsDevice.setFullScreenWindow(null);
            m_timer.stop();
            System.exit(0);
    }Hope this helps.

  • KeyEvents from Console not Applets/Windows

    how to trap KeyEvents from a Console...
    Events like Key and Mouse usually are fired within the framework of Frame or Window objects. How can Key events be trapped from a text-based interface with an user interacting through say a Unix console? Is this possible? For example, I have a simple Java application which opens a Input stream to System.in. Is there a way to pick off when a user types? Any examples?
    thanks - Matthew Young

    this is one way of doing it
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String s;
    s = br.readLine();

  • Add Tab for Real-Time Purchases

    I love the Browse Pets tab. I would love it even more if there was a way to have the search criteria results only include pets that have been purchased during a recent period of time.  I (and others) would definitely be more active if we could easily see that a pet we are about to purchase has recently been purchased by someone else (without having to go to the pet's individual profile each time). Thanks.

    Hi,
    I cann't do my validation in the 'OK' button because
    other inputs depends upon these validations.
    Moreover if i do my validations by trapping keyevents
    then also i am unable to validate for a range and for
    a null value.All JTextFields have a document. You can access the document directly via a call to get document.
    From the getDocument() method, you can call getText() which will allow you to specify a range. I don't see why you can't use a key listener in conjunction with this. Even in the case you couldn't, you could always use a DocumentListener which would have the same effect.
    Secondly, getText() either in the JTextField or the Document returns a string that is non null (to my knowledge). The document must be null in the case of the JTextField in order to produce a null pointer execption. In either case in order for a null to be possible, you must generate an excpetion.
    You can specify a range of text through a document in either a KeyListener, or a DocumentListener, so yes you can specify a range of text to be returned in a KeyListener (or a DocumentListener). In what case would a JTextField return a null from getText()?
    I don't see any reason why you could not use a KeyListener unless you where doing something like querying a database with every key stroke.
    How the heck did J++ get in this picture? J++ is not Java.

  • Catching KeyEvents outside GUI interfaces

    Looking for a way to trap/catch action events (key) from non-GUI components...
    For example, when enter is typed and an application has an InputStream pipe open some kind of event must be fired to read the line or character from System.in. Or?
    Basically, I have an application which responds to user input (right now) only via System.in and System.out pipes. It would be nice to catch KeyEvents when a user types/presses certain keys. It seems that ActionListeners were designed to be attached to GUI components. But I got to believe a simple text based application can also trap similar action events. Any ideas?
    / Matthew Young

    Not sure a follow. Main problem is catching key events via an object/application which does not use GUI components. How does adding a second thread help me out?
    Or do mean initialize a GUI object on the side (but maybe not visible) and pass events via it? Might be a solution but it seems there should be a smoother way.
    Thanks for the idea anyway (will try it out and post my reaction) - Matthew

  • Error Trapping for Report

    I have a access 2013 database.  I am trying to automate generation of 3K+ pdf reports.  I have the following code. It was working in a previous iteration of the code pictured here, but due to some "illegal" characters, was canceling
    the outputTo command lines due to those characters.  i.e. mostly / chars.  So, I wanted to trap those errors and write them to a table, I added the on error statement.  It works for the first record with an illegal character, but second time
    around it cancels the outputTo command.  What am I doing wrong?
    Private Sub OutputAll_Click()
        DoCmd.GoToRecord , , acFirst 
        Dim V_Counter
        V_Counter = 1
        Me.Counter = V_Counter
        Do While V_Counter <= 20
            On Error GoTo FirstReportError
            DoCmd.OutputTo acOutputReport, "NoMeasurementsIPReportForQualityPreview", acFormatPDF, "c:\PDFFiles\" & Me.IPKey
            GoTo NoFirstFeportError
    FirstReportError:
            DoCmd.OpenForm "IPKeyErrorsForm"
            Forms!IpKeyErrorsForm.IpKeyError = Me.IPKey
            DoCmd.Close acForm, "IPKeyErrorsForm"
            DoEvents
            GoTo SkipSecondReportDueToError
    NoFirstFeportError:
            DoCmd.OutputTo acOutputReport, "NoMeasurementsIPReportForQualityPreviewProductionVersion", acFormatPDF, "c:\PDFFiles\" & Me.IPKey & "_ProductionVersion"
            DoEvents
    SkipSecondReportDueToError:
            DoCmd.GoToRecord , , acNext
            V_Counter = V_Counter + 1
            Me.Counter = V_Counter
        Loop
    End Sub
    IPKey on this report is:
    00-5901-981-02_STYLUS BAR 4/6 MM_100_D

    Hans,
    Thanks again for your timely response.  It is now sort of working, but I must be missing one important piece.  Here is what I have.
    Private Sub OutputAll_Click()
        DoCmd.GoToRecord , , acFirst 'Go to the first record
        Dim V_Counter
        V_Counter = 1
        Me.Counter = V_Counter
        Do While V_Counter <= 739
            If V_Counter = 739 Then
                MsgBox "Counter is 739"
            End If
            On Error GoTo FirstReportError
            DoCmd.OutputTo acOutputReport, "NoMeasurementsIPReportForQualityPreview", acFormatPDF, "C:\PDFFiles\" & Me.IPKey & ".pdf"
            Resume NoFirstReportError
    FirstReportError:
            DoCmd.OpenForm "IPKeyErrorsForm"
            Forms!IpKeyErrorsForm.IpKeyError = Me.IPKey
            DoCmd.Close acForm, "IPKeyErrorsForm"
            DoEvents
            Resume SkipSecondReportDueToError
    NoFirstReportError:
            DoCmd.OutputTo acOutputReport, "NoMeasurementsIPReportForQualityPreviewProductionVersion", acFormatPDF, "c:\PDFFiles\" & Me.IPKey & "_ProductionVersion" & ".pdf"
            DoEvents
    SkipSecondReportDueToError:
            DoCmd.GoToRecord , , acNext
            V_Counter = V_Counter + 1
            Me.Counter = V_Counter
        Loop
    Done:
    End Sub
    Only problem is, it does the code after the label "FirstReportError" every time. What am I missing?

  • How to trap Submit button event in OAF

    Hello,
    I'm doing controller extension for create account button in Customer UI.
    Issue: I'm not able to trap the table action to add extra validation logic.
    I tried to use pageContext.getParameters("CreateButton") but it didn't work i.e. debug message was not printed written inside if statement.
    Button Structure:
    TableAction
    Flowlayout
    Submit button.
    Code:
    public void processFormRequest(OAPageContext pageContext,
                                       OAWebBean webBean) {
            //super.processFormRequest(pageContext, webBean);
            OAApplicationModule am = pageContext.getApplicationModule(webBean);
            ArrayList exceptions = new ArrayList();
            OAFlowLayoutBean oaflowlaybean =
                (OAFlowLayoutBean)webBean.findChildRecursive("TableActionsRN");
            OASubmitButtonBean vbuttonBean =
                (OASubmitButtonBean)oaflowlaybean.findChildRecursive("CreateButton");
            String buttonId = vbuttonBean.getID();
            String buttonId12 = vbuttonBean.getName();
            String asd=vbuttonBean.getEvent();
            String s = pageContext.getParameter(EVENT_PARAM);
            String s1 = pageContext.getParameter(vbuttonBean.getName());
                if (s.equalsIgnoreCase("CreateAccount")) {
                OAViewObject vo =
                    (OAViewObject)am.findViewObject("HzPuiAccountTableVO");
                if (vo != null) {
                    pageContext.writeDiagnostics("Jai-1", "VO Found", 1);
                    OARow row = (OARow)vo.getCurrentRow();
                    if (row != null) {
                        pageContext.writeDiagnostics("Jai-2", "Row Found", 1);
                        String partyid =
                            (String)row.getAttribute("PartyId").toString();
                        pageContext.writeDiagnostics("Jai-3", "PartyId" + partyid,
                                                     1);
                        int PartyNum = Integer.parseInt(partyid);
                        String partyacctcnt = null;
                        try {
                            OracleConnection conn =
                                (OracleConnection)pageContext.getApplicationModule(webBean).getOADBTransaction().getJdbcConnection();
                            pageContext.writeDiagnostics("Jai-4", "Inside Try", 1);
                            String query =
                                "SELECT count(1) lcount  FROM HZ_CUST_ACCOUNTS WHERE party_id=:1";
                            PreparedStatement stmt = conn.prepareStatement(query);
                            stmt.setInt(1, PartyNum);
                            ResultSet resultset = (ResultSet)stmt.executeQuery();
                            if (resultset.next()) {
                                pageContext.writeDiagnostics("Jai-5",
                                                             "Inside Result Next",
                                                             1);
                                partyacctcnt = resultset.getString("lcount");
                            stmt.close();
                        } catch (SQLException sqlexception) {
                            throw OAException.wrapperException(sqlexception);
                        int i = Integer.parseInt(partyacctcnt);
                        /*   String HoldFlag = (String)row.getAttribute("Attribute11");
                        // Check Hold Flag: "Y" then restrict to create new account
                        if (HoldFlag == "Y") {
                            pageContext.writeDiagnostics("Jai", "Inside Hold Flag", 1);
                            exceptions.add(new OAException("XXGCO",
                                                           "XXTCO_CREDIT_LIMIT_CHECK",
                                                           null, OAException.ERROR,
                                                           null));
                        // One Party-One Account: Greater or Equal to 1 then throw error mesaage
                        if (i > 1) {
                            pageContext.writeDiagnostics("Jai-6",
                                                         "Inside Account Check",
                                                         1);
                            exceptions.add(new OAException("XXGCO",
                                                           "XXTCO_CREDIT_LIMIT_CHECK",
                                                           null, OAException.ERROR,
                                                           null));
                        if (exceptions.size() > 0) {
                            pageContext.writeDiagnostics("Jai-7",
                                                         "Inside Exceptioon calling",
                                                         10);
                            OAException.raiseBundledOAException(exceptions);
                        } else {
                            pageContext.writeDiagnostics("Jai-8",
                                                         "Inside else Exceptioon calling",
                                                         10);
                           // super.initParametersPFR(pageContext,webBean);
                            vbuttonBean.setFireActionForSubmit(null, null, null, false);
                            super.processFormRequest(pageContext, webBean);
    Please suggest the how to overcome with above mention issue.

    Hi Kiranmai,
    You can capture the event of the radio button in the following way in oninputprocessing.
    DATA: event             TYPE REF TO if_htmlb_data,
                   radioButton_event TYPE REF TO CL_HTMLB_EVENT_RADIOBUTTON.
             event = cl_htmlb_manager=>get_event( request ).
             IF event IS NOT INITIAL AND event->event_name = htmlb_events=>radiobutton.
               radioButton_event ?= event.
               ENDIF.
    you can get the attributes of clicked radio button in
    event->event_class
    event->event_id.
    event->event_name
    event->event_type
    event->event_server_name
    In layout define the radio button as
    <htmlb:radioButtonGroup   id          = "test_id">
            <htmlb:radioButton      id          = "id_red"   text = "Red"               onClick="myClick" />
            <htmlb:radioButton      id          = "id_blue"  text = "Blue"          onClientClick="alert('blue clicked')"/>
            <htmlb:radioButton      id          = "id_green" text = "Green"      onClick="myClick" onClientClick="alert('green clicked')"/>
          </htmlb:radioButtonGroup>
    Hope this will solve your problem.
    Donot forget to assign points for helpful answers.
    Regards
    Aashish Garg

  • HelpSet.findHelpSet() returns null, and trapping ID errors

    I was having a problem initializing JavaHelp. HelpSet.findHelpSet() was returning null. I searched the forum, and found it was a common problem, but the answers were unhelpful. The answers pointed to a problem with CLASSPATH, but offered little in the way of advice for a newbie like myself on how to deal with it.
    A second issue concerns HelpBroker.enableHelpOnButton(). If you feed it a bogus ID, it throws an exception, and there's no way to trap it and fail gracefully. JHUG doesn't provide much in the way of alternatives.
    Now, having done a bit of research and testing, I'm willing to share a cookbook formula for what worked for me.
    I'm working in a project directory that contains MyApp.jar and the Help subdirectory, including Help/Help.hs. My first step is to copy jh.jar to the project directory.
    Next, in the manifest file used to generate MyApp.jar, I add the line:
        Class-Path: jh.jar Help/I'm working with Eclipse, so in Eclipse, I use Project - Properties - Java Build Path - Libraries to add JAR file jh.jar, and Class Folder Tony/Help
    I define the following convenience class:
    public class HelpAction extends AbstractAction
        private static HelpBroker helpBroker = null;
        private String label = null;
        public HelpAction( String name, String label )
            super( name );
            this.label = label;
        public void actionPerformed( ActionEvent event )
            displayHelp( label );
        public static boolean displayHelp( String label )
            if ( helpBroker == null )
                Utils.reportError( "Help package not initialized!" );
                return false;
            try
                helpBroker.setCurrentID( label );
                helpBroker.setDisplayed( true );
                return true;
            catch ( Exception e )
                Utils.reportError( e, "Help for " + label + " not found" );
                return false;
        public static boolean initialize( String hsName )
            URL hsURL = HelpSet.findHelpSet( null, hsName );
            if ( hsURL == null )
                Utils.reportError( "Can't find helpset " + hsName );
                return false;
            try
                HelpSet helpSet = new HelpSet( null, hsURL );
                helpBroker = helpSet.createHelpBroker();
            catch ( HelpSetException e )
                Utils.reportError( e, "Can't open helpset " + hsName );
                return false;
            return true;
    }If you use this class in your own code, you'll want to replace Utils.reportError() with something of your own devising.
    Finally, in my GUI class, I use the following:
        JPanel panel = ...
        JMenu menu = ...
        JToolbar toolbar = ...
        HelpAction.initialize( "Help.hs" )
        Action gsAction = new HelpAction( "Getting Started Guide", "gs.top" );
        menu.add( gsAction );
        JButton helpButton = new HelpAction( "Help", "man.top" );
        toolbar.add( helpButton );
        InputMap imap = panel.getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );
        imap.put( KeyStroke.getKeyStroke( "F1" ), "F1help" );
        ActionMap amap = panel.getActionMap();
        amap.put( "F1help", new HelpAction( null, "man.top" ) );

    Sorry, the sixth-from-last line of my example should read,
        JButton helpButton = new JButton( new HelpAction( "Help", "man.top" ) );

  • Maddening issue with text... trapping?

    I have recently taken over as acting editor for a PDF-only publication with a very small audience. My previous experience with InDesign has been with preparing files for CMYK printing, so this is my first opportunity to prepare a document specifically for on-screen display.
    I am using a background image on several pages within the document. However, it would seem that no matter what I do, the resulting PDF does some funny things to the text.
    I have trapping turned off throughout the document, all my text is created from the [black] swatch, and I've specified "overprint fill" in the attributes menu just for good measure. However, no matter how I export my PDF, I get one of two issues:
    (1) With "convert to destination" selected and a CMYK colorspace as the destination, OR with "no color conversion" selected, I end up with trapped text on pages that have a background image, even though the background image only covers a portion of the page. Pages with no background image display text properly.
    (2) with "convert to destination" selected and an RGB colorspace as the destination, I end up with trapped text on pages that have a background image, but only where the background image does NOT appear.
    This is confusing because, in each instance, there's no valid reason for InDesign or Acrobat to display a trap. I've tried creating a trap setting with 0pt specified for the trap, and it doesn't help. See http://www.caves.org/grotto/lrg/images/indesign_frustrations.png for a screenshot of the issue.
    What on earth is going on? I just want overprinting black text to display as untrapped black text, and none of my export options seem to allow the PDF to appear as it does when I have "overprint preview" selected within InDesign. It's imperative that the text be crisp and legible on-screen, and the bloated, messy trapped-looking text is much more difficult to read at "fit page" -level zooms of less than 100%.
    I'm using InDesign CS3 on a Windows machine running Vista 64 with 6MB of RAM. I have not observed any other problems with the CS3 family of products. The font being utilized is Adobe Garamond Pro.
    thanks in advance to anyone who can shed light on the issue.
    on my last nerve,
    jeff

    I don't think you are seeing trapping I think you are seeing the results of flattening due to the use of transparency. Some text is either rasterized or converted to outlines. When outlined, text appears heavier because it does not benefit from hinting. You can reduce the use of transparency effects, export to a transparency-savvy version of PDF, or put the text above the transparency issues.
    I suggest a combination. Make a layer for the text above other layers and put all the text there that you can without mucking up the layout. Export to Acrobat 5 (PDF 1.4) or higher to avoid flattening.

  • CS5 TEXT TRAPPING options? Knockout? 0.44? Overprint?

    Is there no option in InDesign CS5 for the text trapping?
    How can I be sure that the text I want to be knockout is in fact set to knockout? and likewise for text to be overprinted?
    Am I to assume that everything is automatic and I have to trust InDesign to decide it for me?
    I will be taking a project to the printers soon, and I NEED to be sure for myself that all the overprint and knockout text is set correctly, but I can't find the settings anywhere.
    Help, guidance and anything else very much appreciated.

    le_mac_man wrote:
    Thanks for your reply.
    So, are you saying that every other colour except black will knockout automatically?
    In the "attributes" panel the options are:
    Overprint Fill
    Overprint Stroke
    Nonprinting
    Overprint Gap
    Why is there not an option, "knockout Fill" etc... or is it just given that if the overprint fill box is not ticked then that means it will knockout?
    There is no option for Knockout because that's the default condition, and the only possibility if overprint isn't selected. You can't "sort of" or half overprint any more than you can "sort of" print red using black ink.

  • Error trapping with OPEN FOR

    I am trying to add some error handling to this packaged procedure written by someone else.
    How can I check for an Oracle error in the query in m_sql_string? I have tried checking
    SQLCODE after the 'OPEN FOR', but it is always 0 even when errors are being encountered.
    I need to trap errors and write them to an error table.
    CREATE OR REPLACE PACKAGE P1
    AS
    TYPE CHCUR IS REF CURSOR;
    PROCEDURE QRY_WR_STATUS_CHANGES (tsAfter IN VARCHAR2, rsResult OUT CHCUR);
    END P1;
    CREATE OR REPLACE PACKAGE BODY P1
    AS
    PROCEDURE QRY_WR_STATUS_CHANGES(tsAfter IN VARCHAR2, rsResult OUT CHCUR)
    IS
    m_sql_string VARCHAR2(30000);
    BEGIN
    m_sql_string := 'SELECT TS_STATUS, CD_STATUS, CD_WR, RowId
    FROM TABLE_A
    WHERE
    NOT EXISTS (SELECT ''X'' FROM TABLE_B where TABLE_B.USER_NAME =TABLE_A.ID_OPER)
    ) AND
    NOT EXISTS (SELECT ''X'' FROM TABLE_C where TABLE_C.wr = TABLE_A.CD_WR and
    TABLE_C.dist = TABLE_A.CD_DIST)
    AND
    TABLE_A.TS_STATUS >
    TO_DATE('''||tsAfter||''', '||'''MM/DD/YYYY HH24:MI:SS'')
    AND CD_STATUS Like ''%X''';
    OPEN rsResult FOR m_sql_string;
    END QRY_WR_STATUS_CHANGES;
    END P1;
    Thanks in advance.

    Thank you. I just tried adding such an exception block. It compiles and runs fine, but isn't trapping the error. I see the error returned in the results when I call the proc from SQL*PLUS, but can't seem to trap it in the code...it's like I need to check the contents of the OUT data for the error or something. Below is the modified code and then showing executing it and the results. Any further ideas are greatly appreciated.
    CREATE OR REPLACE PACKAGE P1
    AS
    TYPE CHCUR IS REF CURSOR;
    PROCEDURE QRY_WR_STATUS_CHANGES (tsAfter IN VARCHAR2, rsResult OUT CHCUR);
    END P1;
    CREATE OR REPLACE PACKAGE BODY P1
    AS
    PROCEDURE QRY_WR_STATUS_CHANGES(tsAfter IN VARCHAR2, rsResult OUT CHCUR)
    IS
    m_sql_string VARCHAR2(30000);
    BEGIN
    m_sql_string := 'SELECT TS_STATUS, CD_STATUS, CD_WR, RowId
    FROM TABLE_A
    WHERE
    NOT EXISTS (SELECT ''X'' FROM TABLE_B where TABLE_B.USER_NAME =TABLE_A.ID_OPER)
    ) AND
    NOT EXISTS (SELECT ''X'' FROM TABLE_C where TABLE_C.wr = TABLE_A.CD_WR and
    TABLE_C.dist = TABLE_A.CD_DIST)
    AND
    TABLE_A.TS_STATUS >
    TO_DATE('''||tsAfter||''', '||'''MM/DD/YYYY HH24:MI:SS'')
    AND CD_STATUS Like ''%X''';
    OPEN rsResult FOR m_sql_string;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('Error code is: Long postings are being truncated to ~1 kB at this time.

  • Questions on Receiving SNMP Traps

    Hi:
    - I have more questions on receiving SNMP traps:
    1) the OEM plug-in can receive traps now, but when I click the metric, I see:
    Error getting data for target test20. Exception: ORA-20216: ORA-06512: at "SYSMAN.EMD_MNTR", line 817 ORA-01403: no data found ORA-06512: at line 1
    - the push descriptor looks like:
    <PushDescriptor RECVLET_ID="SNMPTrap">
    <Property NAME="MatchEnterprise" SCOPE="GLOBAL">...</Property>
    <Property NAME="MatchGenericTrap" SCOPE="GLOBAL">6</Property> <Property NAME="MatchSpecificTrap" SCOPE="GLOBAL">31</Property> <Property NAME="MatchAgentAddr" SCOPE="INSTANCE">target_ip</Property>
    <Property NAME="EventsnChasFanIndexOID" SCOPE="GLOBAL">...</Property>
    <Property NAME="ContextsnChasFanDescriptionOID" SCOPE="GLOBAL">...</Property>
    <Property NAME="SeverityCode" SCOPE="GLOBAL">WARNING</Property>
    </PushDescriptor>
    - is the Key Property needed ?
    2) The alerts for some reason do not filter back to the all targets home page.
    - When I click the Home tab and goto to the 'All Targets' pane, I do not see the alert generated by the OEM plug-in.
    - What I am doing wrong ?
    3) Is it okay to receive traps with the metric usage set to either: HIDDEN or HIDDEN_COLLECT ?
    - Does this cause the errors I see in Q 1) ?
    Thanks
    John
    Edited by: user8826739 on Feb 23, 2010 7:05 AM

    Hi John,
    Can you post the full definition of the metric? You would need to use the Key property for each key column in the metric description.
    With the SNMP receivelet you can set up definitons for data points or alerts. I would assume (as I've never tried this ;) that if you set up the definition to be a data point, you would see data from the All Metrics page. To me, it wouldn't make sense for a metric that used the PushDescriptor SNMPTrap to have data to be viewed as the result of the SNMP trap coming is would be an alert. I will have to look into that. My gut reaction is that a metric with PushDescriptor SNMPTrap shouldn't even appear on the All Metrics page ...
    To be clear are you saying that you don't see the Warning number under "All Targets Alerts" increase by 1 when you SNMP trap is caught and alert is generated? When this occurs do you see the alert on the target instance homepage?
    In regards to HIDDEN and HIDDEN_COLLECT, I don't know what effect they would have on a metric defined for an SNMP trap to raise an alert. You definitely wouldn't want to use HIDDEN as this setting is for temporary metrics that are used in the caclulation of other metrics. HIDDEN metrics are not collected (or hence uploaded to the OMS) and don't appear in the UI. HIDDEN_COLLECT are collected, but do not show up in the UI and are not uploaded. I've never used this settings with SNMP trap metrics that are for alerts. If your metrics for the SNMP trap alerts do show up on the All Metrics page (I'd have to get something set up to look at this), then it could make sense to use the HIDDEN_COLLECT as the alert would still be generated, but the metric itself wouldn't be shown in the UI.
    Let me find out the expected behavior from someone on the agent team.
    Dave

  • My iphone 4s is trapped into recovery mode & i cant get my phone out of it!

    Recently I Buy A iPhone 4s.after 1 day use,i reallize that my phone have no panorama.so after that i take some picture and record a video.then i moved them into  my pc.but then i saw my picture quality is 5mp and video is 720p.then i inform to someone and he told me,'may be this is for your ios version.you should update your ios version 7.0.6 to 7.1.1.then i tried to update my phone..but updating&restoring was running then i get into sleep.after some time i woke up and saw my phone is trapped into recover mode..then i reconnect my device into itunes.but now itunes is showing me that my phone is iphone 4.but some time ago itunes showing me this is a 4s.then i take it to the iphone mechanic and he told me this phone wont be alright.this phone's mainboad is damage.then iii tried hard to turned my phone into normal mode..i saw every vedio on youtube,and i used every software to made my phone into normal mode.but nothiing is work on my phone...i download some .ipsw file of iphone 4 and 4s ios 7.1.1.i tried to restore my phone with shift key/button with ipsw file.but every time it cancelled when restore is 75% done and also everytime restore is cancelled when firmware is installing.and it says me "THIS PHONE CANT BE RESTORE.AN UNKNOWN ERROR OCCURED.(3194)"
    so i think my phone's firmware file is broken...or my phone is dead
    so if anybody is here,who can solve my problem, plz help to solve my problem
    i used my phone only 1 day after i bought it and i bought this phone with a big costs.
    THANK YOU!!

    Make sure you have the Current Version of iTunes Installed on your computer
    iTunes free download from www.itunes.com/download
    Shahariar Khan wrote:
    "THIS PHONE CANT BE RESTORE.AN UNKNOWN ERROR OCCURED.(3194)"
    3194  = http://support.apple.com/kb/ts4451
    If that Article does not resolve it... then you have a problem.
    Perhaps a Visit to an Apple Store or AASP (Authorized Apple Service Provider) is required..
    Be sure to make an appointment first...
    Note:
    That error message may be indicative of the Device being Hacked / jailbroken.... If this is the case then you are on your own.
    Unauthorized modification of iOS  >  http://support.apple.com/kb/HT3743

  • What is the minimum server layer OEM version supports SNMP trap reception ?

    Hi:
    - I have been trying to enable SNMP trap reception on an OEM plug-in.
    - I turned on debug channel for recvlets.snmp and saw:
    2009-10-16 16:07:42,808 Thread-3028552624 ERROR recvlets.snmp: Duplicate threshold : test900, oracle_guide, interfaces, status
    and
    2009-10-16 16:09:08,382 Thread-3021634480 INFO recvlets.snmp: Trap received is to convert Data Point
    2009-10-16 16:09:08,379 Thread-3021634480 INFO recvlets.snmp: Sending Data Point ...
    2009-10-16 16:09:08,379 Thread-3021634480 INFO recvlets.snmp: Listening for TRAP
    So, it looks like the OEM agent can receive traps but no data point or alert appears.
    And, the agent always issues an error about duplicate thresholds.
    - Does the agent have to be patched ?
    My agent is:
    Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
    Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
    Agent Version : 10.2.0.5.0
    OMS Version : 10.2.0.1.0
    Protocol Version : 10.2.0.0.0
    Agent is Running and Ready
    - on the server layer, the oms is:
    Oracle Enterprise Manager 10g Release 10.2.0.1.0
    Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
    Oracle Management Server is Up.
    Is a patch needed for OMS ?
    Should OMS be version 10.2.0.5.0 ?
    Thanks
    John
    Edited by: user8826739 on Feb 23, 2010 7:17 AM

    10.2.0.5 should be fine ...
    Dave

Maybe you are looking for