How do I make content in a text field continue onto a new page?

I am creating a form and one of the pages contains a text field for an essay. I'd like the responses in this text field to carry onto new pages if they reach the end of the first page. How do I make new pages appear with only the continued text field? Thanks!

All right...
public class guiClient extends JFrame implements ActionListener {
static String userString;
static String currentFont;
String fontchoice;
String fontlist;
static JTextField userName = new JTextField();
public guiClient() {
     super("My Client");
public guiClient() {
     super("My Client");
// Create a ComboBox
GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
String envfonts[] = gEnv.getAvailableFontFamilyNames();
Vector vector = new Vector();
for ( int i = 1; i < envfonts.length; i++ ) {
vector.addElement(envfonts);
JComboBox fontlist = new JComboBox (envfonts);
     fontlist.setSelectedIndex(0);
     fontlist.setEditable(true);
     fontlist.addActionListener(this);
     fontchoice = envfonts[0];     
//Create a regular text field.
     JTextField textField = new JTextField(10);
     textField.setActionCommand(textFieldString);
     textField.addActionListener(this);
public void actionPerformed(ActionEvent e) {
//if the action is from the textfield (e.g. user hits enter)
     if (e.getActionCommand().equals(textFieldString)) {
          JTextField fromUser = (JTextField)e.getSource();
     if (fromUser != null){
//place user text in editor pane
//send message to server
               if (userName.getText() != null) {
                    userString = userName.getText().trim();
               out.println(userString + ": " + fromUser.getText());
          fromUser.setText("");
     else if (e.getActionCommand().equals(fontlist)){
     JComboBox cb = (JComboBox)e.getSource();
String newSelection = (String)cb.getSelectedItem();
currentFont = newSelection;
     userString = currentFont;
return;

Similar Messages

  • Is there a way to have a text box continue onto a new page

    I can no longer link text boxes from one page to the next. So, I want to create a text box and just have it continue onto a new page, and then another page, etc., etc. because there are things we want to do with that text....that's why it's in a text box. Any suggestions.

    Just 1 of a hundred features removed from Pages 5.2.
    Pages '09 should still be in your Applications/iWork folder. Use it.
    Peter

  • How to Print All Content hidden in Text Field

    Apologies if this has been answered elsewhere. I can't seem to find a solution that works
    I am trying to get a text field, which is fixed in size on screen and which includes more text than visible (contains + sign in corner) to print all the text within it.
    I'm assuming this can be done and I am simply not producing my form correctly.
    Any help greatly appreciated!
    Ken

    There are some options:
    - You can set the font size to Auto, but then you run the risk of the text being too small.
    - You can set up empty fields at the end of the form and populate them with the text just before printing. That would require a custom-made script.

  • IWeb • How Do I Make Links in an Embedded PDF Document Open in New Page?

    On this page http://ostyn-newman.com/Gov_Downloads.html I have a PDF document that is embedded.  I tried an IFrame, but everything seemed to work better for me with the "Embed" code.  I am open to changing this if it would be better.  Here's my problem.  I can get the PDF document to display fine, but when I click on the links in the PDF document, the destination page opens in the embedded window.  I want the links to open the destination in a new window.
    I created the part of the document with most of the links (Pages 8.5 - 56) in Numbers and cut and pasted the table into a Pages document to create the completed document on our site.  I exported the docuemnt from Pages as a PDF file which is what you see.  There is also a link to download the file on the same page which works just fine.
    I have tried to insert the target="_blank" code but have not been able to get it to open the destination pages in a new window.  I am inserting the code by using the Insert/Widget/HTML Snippet Feature in IWeb.  Here is the code I am using.
    <embed src=
    "http://ostyn-newman.com/Media/GS27F0026XTextfile.pdf"
    style="width:850px; height:1000px;
    border-width:0px;
    border-color:#FFCC66;
    border-style:solid;"
    scrolling="auto" >
    </embed>
    I am not a coder and have just used Google to find the code to cut and paste and have played around with it to get to the place I am.  If anybody can tweak the code I have or offer some totally new code for me to insert that will get this to work would be greatly appreciated.
    Please keep in mind that most of the people who visit and use this page are government employees and are almost exclusivey using Explorer. 

    Thank you Jeff,
    I tried your original suggestion and now my inserted html widget reads
    <embed src=
    "http://ostyn-newman.com/Media/GS27F0026XTextfile.pdf"
    style="width:850px; height:1000px;
    border-width:0px;
    border-color:#FFCC66;
    border-style:solid;"
    scrolling="auto" target="_blank">
    </embed>
    It is live on my site.  You can see that the embedded document still opens the destination links in the embedded window.
    As for your other two suggestions, thank you as well.  I am aware of those techniques and did not use them because that is not how I want the other PDF links on the page to behave.  The catalog and autocad blocks downloads in the box at the top should simply download (or behave however the client's browser is configured to handle downloaded PDF documents or zip files.)  I don't intend to force those to open a new window.  I could also have our client click on a link to the PDF document and open it in a new page (like in your second suggestion) but I was hoping to embed the PDF and have it automatically viewable on our Download • Terms • Prices Page with all of the PDF search functions intact as well as the links be active.  My only complaint at this point is that the links in the embedded PDF document open the destination page in the embed window instead of a new window.  I only want to force a new window because the destination window doesn't behave properly when it opens in my embed window and it is difficult to figure out how to go back to the my PDF document when a destination window gets opened in the embed window.  The code you sent didn't do the trick.  Or maybe I didn't get it exactly right.  That is why I included it above.  Thanks for trying though.  I appreciate the effort.
    I would be willing to bypass the imbed/iFrame route altogether if I could just somehow drop the Pages document into the IWeb page and retain the search and link features, but I've not been able to figure out how to do that.  When I was exploring how to directly drop a Pages document into an IWeb page is when I stumbled on the method of embedding a PDF document into an IWeb page to retain the important search and link features.

  • How to insert a date picker input text field in a JSF Jsp page

    Hi,
    I have to develop an application using generic facets, unfortunately I am not supposed to use ADF Faces components given by Oracle.
    Now my requirement is, on JSP page an input text field which holds a DATE value is required, it should also have a Date Picker Calendar adjacent to it.
    Could you pls shed some light on this issue and help me out.
    Thanks
    ~Siva(ji)

    <HTML>
    <script language="JavaScript" type="text/javascript">
    <!--
    var pUpWidthc = 300; //Change the pUpWidthc to your requirements.
    var scrAvailc = 400;     //Change to your available screen width. You see in
    //this eBooks' middle frame, the frame width is
                                                                //equal to 410 . So whether your using frames or
                                                                //or a full 800 pixel screen, you must calculate
                                                                //your available screen width.
    var PopUpC = document.getElementById("pUpc");
    document.write('<div id="pUpc" style="visibility:hidden;z-index:4;width:'+pUpWidthc+';position:absolute;"></div>');
    function cstmPup(objC,c){
    popUpC = document.getElementById("pUpc");
    popUpC.innerHTML = c.innerHTML
    popUpC.style.left = getPos(objC,"Left");
    var scrNeedc = getPos(objC,"Left") + pUpWidthc;
    if (scrNeedc > scrAvailc){
    //The number 10 below is an extra offset x value applied when the
    //definitional popup box positions beyond your screen width. You
    //can change this number to fine tune your "beyond screenwidth" positioning.
    var scrOffsetC = getPos(objC,"Left") + pUpWidthc - (scrAvailc);
    popUpC.style.left = getPos(objC,"Left") - (scrOffsetC - 0);
    popUpC.style.top = getPos(objC,"Top") + objC.offsetHeight;
    popUpC.style.visibility = 'visible';
    fill();
    function fill()
         var noOfRows=7,noOfCols=7,i=0,j=0,day=1,x;
    var d1=FirstDayOfWeek(7,2008);
    //40     
         for(i=1;i<noOfRows;i++)
              x=document.getElementById('myTable').insertRow(i);
              for(j=0;j<noOfCols;j++)
                   var y=x.insertCell(j);
                   if( ( i==1 && j<d1))
                   y.innerHTML="";
                   else if(day<=DaysInMonth(7,2008)){
                   y.innerHTML=day;
                   day++;
    //document.write(FirstDayOfWeek(7,2008));
    function FirstDayOfWeek(m,y)
    var i;
    var dow = 6;
    //document.write("Hello");
    for (i=1583; i<y; i++)
    dow += (LeapYear(i)) ? 2 : 1;
    for (i=1; i<m; i++)
    dow += DaysInMonth(i,y);
    return dow % 7;
    function DaysInMonth(m,y)
    // m is the month number (1,2,3,...12), y is the year number (four digits)
    switch (m)
    case 1:
    case 3:
    case 5:
    case 7:
    case 8:
    case 10:
    case 12: return 31;
    case 2: if (LeapYear(y))
    return 29;
    else
    return 28;
    default: return 30;
    function LeapYear(y)
    return (y % 4==0) && ((y % 100!=0) || (y % 400==0));
    function getPos(objC,sPos){
    var iPos = 0;
    while (objC != null) {
    iPos += objC["offset" + sPos];
    objC = objC.offsetParent;}
    return iPos;
    function hPopUpc(){
    popUpC = document.getElementById("pUpc");
    popUpC.style.visibility = 'hidden';
    //-->
    </script>
    <BODY
    <button id="c1" onclick="cstmPup(c1,pUpCstm)">Custom PopUp</button>
    <'div' id="pUpCstm" style="display:none;">
    <'div' id="myid" align="left" style=" width:100%; height:100%; background:#cccccb; border:1px solid black; border-top:1px solid white; border-left:1px solid white; padding:10px; font:normal 10pt tahoma; padding-left:18px "> <b>Rich Message Boxes</b>
    <hr size="1" style="border:1px solid black;">
         <div style="width:220px; font-family:tahoma; font-size:80%; line-height:1.5em"><br>
              <table border ="1" id="myTable">
                   <TR>
                        <TD> SUN </TD>
                        <TD> MON </TD>
                        <TD> TUE </TD>
                        <TD> WED </TD>
                        <TD> THU </TD>
                        <TD> FRI </TD>
                        <TD> SAT </TD>
                   </TR>
              </table>
         <br><br>
         </div>
         <br>
         <div>
    <button tabindex="-1" onclick="hPopUpc()" style="border:1px solid black; border-left:1px solid white; border-top:1px solid white; background:#cccccc ">Close Message</button>
    </div>
    <?BODY
    </HTML>
    Message was edited by:
    mchepuri
    Message was edited by:
    mchepuri
    Message was edited by:
    mchepuri

  • Trying to retrieve content from a text field & use it in a conditional statement

    Hi Everyone,
    I have a form with a text field and a button. The  text field is called "orderNo", and the button is called "genOrder".
    Initially  the text field is empty, and clicking on the button fills the text  field with an appropriate order number.
    I need to check the text  field for data (content) before writing the order number to it, this  way if an order number is already present in the text field it will not  be over written.
    My intention is to use an if / else structure to  perform the testing, however I don't know how to retrieve the content  of the text field (if content is present!).
    If anybody can  suggest how I can go about retrieving the content of the text field and  then use it in an if / else statement it will be greatly appreciated.
    Kind  Regards,
    Davo

    Hi try67,
    Thanks for your assistance. I have posted in this http://www.acrobatusers.com/forums/aucbb/viewtopic.php?pid=70276#p70276 forum asking for further assistance if your able to help more.
    Once again thanks for your time.
    Cheers
    Davo

  • How to read the content of a text file (by character)?

    Guys,
    Good day!
    I'm back just need again your help. Is there anyone knows how to read the content of a text file not by line but by character.
    Please help me. Thank you so much in advance.
    Jojo

    http://java.sun.com/javase/6/docs/api/index.html
    package java.io
    InputStream.read(): int
    Reads the next byte of data from the input stream.
    Implementation:
    InputStreamReader
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.

  • How do i split content from the text file using tab and spaces...?

    Hi.. Just want to ask help to all the experts. Im new in java and i have this problem on how to split the contents of the text file. ill show you the contents in order to let you see what i mean.
    FileName: COL.txt
    AcctNo AcctName Primary Secondary Status Opendate
    121244 IPI Company Noel Jose Active 12/05/2007
    As you can see the content i want to split it per column.. Please help me

    Jose_Noel wrote:
    Hi prometheuzz,
    What do you mean by one thread...?You created two threads* with the same question in it. That way, people might end up giving you an answer that has already been posted in your other thread: thus wasting that person's time.
    Just don't create multiple threads with the same question please.
    * a thread is a post here at the forum

  • Script needed to print complete contents in scrolling text field Acrobat Pro 9 (MAC)

    I've seen this question several times in my search but no real solution. My client wants a form with text fields that only show 1-2 lines when viewed on-screen but are scrollable so that the user can input a lot of text. I had no problem creating that. The problem occurs when I try to print the form. Only the visible lines of text print and not the entire contents of the field. 
    Is there a Javascript that I can assign to a Print button in my form that can be assigned to the Mouse Down action that will make the entire field contents print? I even recreated the form in WORD so that when the user inputs text into the field, the contents of the form move down the page. My client didn't like that approach. I'm not a programmer and so I haven't been able to write my own script to handle the printing issue. I'm MAC based so using Livecycle isn't an option for me. Thanks!

    I'm using Acrobat Professional 9. I used to use Livecycle which was more flexible, but I no longer have a PC, only MAC and Adobe doesn't make Livecycle for the MAC. 
    The client doesn't want larger fields unfortunately. They have questions that require 2 or 3 pages of information to be entered into a small text field but they don't want large fields. If they're reviewing the answers online, it's fine - they can just scroll through the text fields and read the answers but they don't want the completed text fields to expand unless the form is printed.
    I've already set up my text fields to be multi-line and scrollable so that the client can review all of the text in the field if they are looking at the saved PDF online. The problem I'm having is that I need the entire contents of the text field to be visible ONLY when printed out. They don't want larger fields to show in the form. The client was quite specific about it. The form is also going to be used infrequently, so collecting the data and storing it on a server isn't something they're particularly interested in. The information is also confidential, so they do not want me to be collecting and storing the data and sending it back to them in another format. The easiest option I could see was to create a script tied to a PRINT button that printed out the complete text field.
    Thanks!

  • I'm moving from a iPhone 4S to an iphone 5s but and I'm changing SIM card with same number but I want to make sure that all my pictures go onto my new phone how can I do that?

    I'm moving from a iPhone 4S to an iphone 5s but and I'm changing SIM card with same number but I want to make sure that all my pictures go onto my new phone how can I do that?

    Hello Bethanygrace_m7,
    Thank you for contacting Apple Support Communities. You can take a look at this article about transferring content from your old iPhone to a new one:
    Transfer content from an iPhone, iPad, or iPod touch to a new device
    http://support.apple.com/kb/HT2109
    Here is another thread from the Communities about migrating data from an old iPhone to a new one:
    Migrating data from old to new iPhone?: Apple Support Communities
    https://discussions.apple.com/thread/2038778
    Regards,
    Jeff D.

  • Clear the content of a text field

    hello guys,
    i have text fields in a screen which are been populated in the PBO. Now i want to clear the content of the  text field such that the user can input new values in those text field.
    so, anyone knows how i can achieve this.
    tried,
    text field name = ' ', space.
    clear text field name.
    but none worked.
    thanks you for ur help.

    Hi,
    I think you have doen some thing like this in PBO.
    screen_field_name = 'some value'.
    So now in PAI you can do the following.
    CASE sy-ucomm.
         WHEN 'F_CLEAR'.    " Fcode for the clear button in the screen.
          CLEAR : field_name.
      ENDCASE.
    If the field is a mandatory field then you need to create a AT EXIT module and write the same code in that.
    Hope it helps you.
    Thanks,
    Sri.

  • How do you make tabbing skip a disabled field?

    Hi, how do you make tabbing skip a disabled field?
    I have a checkbox. If it's checked, one radio button in a radio button group is disabled. However, user can still tab into this disabled radio button. Once it's in there, it cannot tab out or use up & down arrow to move out of the disabled radio button. It just gets stuck there.
    I tried setting access="protected". But it makes no difference.
    Is there a way to exclude a disabled field from receiving a tab in LiveCycle Designer?
    Thanks.

    You may create your JTextField with the text i.e.
    JTextField myTextField = new JTextField("text");
    or anywhere in your program
    myTextField.setText("text");

  • How do I change fonts in a Text field ??

    Okay I've tried to implement a JComboBox that allows the user to change fonts in the text field. So far I've tried different methods to do it but to no avail. Could somebodoy here read the programs source code for me and tell me where I went wrong?
    /* * My GUI Client */
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.*;
    import javax.swing.event.*;
    //for HTML Headers
    import javax.swing.text.StyledEditorKit.*;
    import javax.swing.text.html.HTMLEditorKit.*;
    import javax.swing.text.html.*;
    import javax.swing.event.HyperlinkListener;
    import javax.swing.event.HyperlinkEvent;
    import javax.swing.event.HyperlinkEvent.EventType;
    import javax.swing.text.html.HTMLFrameHyperlinkEvent;
    //for layout managers
    import java.awt.event.*;
    //for action and window events
    import java.io.*;
    import java.net.*;
    import java.awt.GraphicsEnvironment;
    //for font settings
    import java.lang.Integer;
    import java.util.Vector;
    import java.awt.font.*;
    import java.awt.geom.*;
    public class guiClient extends JFrame implements ActionListener {
    protected static final String textFieldString = "JTextField";
    protected static final String loadgraphicString = "LoadGraphic";
    protected static final String connectString = "Connect";
    static JEditorPane editorPane;
    static JPanel layoutPanel = new JPanel(new BorderLayout());
    static JPanel controlPanel = new JPanel(new BorderLayout());
    static JPanel buttonPanel = new JPanel(new BorderLayout());
    static JPanel fontPanel = new JPanel(new BorderLayout());
    static PrintStream out;
    static DrawPanel dPanel;
    static DrawPanel dPButton;
    static DrawPanel dFonts;
    static DrawControls dControls;
    static DrawButtons dButtons;
    static String userString;
    static String currentFont;
    String fontchoice;
    String fontlist;
    static JTextField userName = new JTextField();
    public static JMenuBar menuBar;
    private static JButton connectbutton = new JButton("Connect");
    static boolean CONNECTFLAG = false;
    //create the gui interface
    public guiClient() {
         super("My Client");
    // Create a ComboBox
    GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
    String envfonts[] = gEnv.getAvailableFontFamilyNames();
    Vector vector = new Vector();
    for ( int i = 1; i < envfonts.length; i++ ) {
    vector.addElement(envfonts);
    JComboBox fontlist = new JComboBox (envfonts);
         fontlist.setSelectedIndex(0);
         fontlist.setEditable(true);
         fontlist.addActionListener(this);
         fontchoice = envfonts[0];     
    //Create a regular text field.
         JTextField textField = new JTextField(10);
         textField.setActionCommand(textFieldString);
         textField.addActionListener(this);          
    //Create an editor pane.
    editorPane = new JEditorPane();
         editorPane.setContentType("text");
         editorPane.setEditable(false);
    //set up HTML editor kit
         HTMLDocument m_doc = new HTMLDocument();
         editorPane.setDocument(m_doc);
         HTMLEditorKit hkit = new HTMLEditorKit();
         editorPane.setEditorKit( hkit );
         editorPane.addHyperlinkListener( new HyperListener());
    //Create whiteboard
    dPanel = new DrawPanel();
    dPButton = new DrawPanel();
    dFonts = new DrawPanel();
    dControls = new DrawControls(dPanel);
    dButtons = new DrawButtons(dPButton);
         //JLable fontLab = new JLabel(fontLable);
    //fontLab.setText("Fonts");
    //Font newFont = getFont().deriveFont(1);
    //fontLab.setFont(newFont);
    //fontLab.setHorizontalAlignment(JLabel.CENTER);
    JPanel whiteboard = new JPanel();
    whiteboard.setLayout(new BorderLayout());
    whiteboard.setPreferredSize(new Dimension(300,300));
    whiteboard.add("Center",dPanel);
    whiteboard.add("South",dControls);
    whiteboard.add("North",dButtons);
         JScrollPane editorScrollPane = new JScrollPane(editorPane);
         editorScrollPane.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
         editorScrollPane.setPreferredSize(new Dimension(250, 145));
         editorScrollPane.setMinimumSize(new Dimension(50, 50));
    //put everything in a panel
         JPanel contentPane = new JPanel();
         JPanel fontPane = new JPanel();
         contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
    //add whiteboard
         contentPane.add(whiteboard);
    //add editor box
         contentPane.add(editorScrollPane);
    //add spacer
         contentPane.add(Box.createRigidArea(new Dimension(0,5)));
    //add textfield
         contentPane.add(textField);
    //set up layout pane
         //layoutPanel.add(GridLayout(2,1),fontLab);
         layoutPanel.add( BorderLayout.NORTH, fontlist);     
         layoutPanel.add(BorderLayout.WEST,new Label("Name: ")); //add a label
         layoutPanel.add(BorderLayout.CENTER, userName ); //add textfield for user names
         layoutPanel.add(BorderLayout.SOUTH, connectbutton);//add dropdown box for fonts
         //fontPane.add(BorderLayout.NORTH,fontlist);
         contentPane.add(layoutPanel);
         contentPane.add(controlPanel);
         contentPane.add(buttonPanel);
    //Create the menu bar.
    menuBar = new JMenuBar();
    setJMenuBar(menuBar);
    //Build the first menu.
         JMenu menu = new JMenu("File");
         menu.setMnemonic(KeyEvent.VK_F);
         menuBar.add(menu);
    //a group of JMenuItems
         JMenuItem menuItem = new JMenuItem("Load Graphic", KeyEvent.VK_L);
         menu.add(menuItem);
    menuItem.setActionCommand(loadgraphicString);
         menuItem.addActionListener(this);
    connectbutton.setActionCommand(connectString);
    connectbutton.addActionListener(this);
         setContentPane(contentPane);
    static private void insertTheHTML(JEditorPane editor, String html, int location) throws IOException {
         HTMLEditorKit kit = (HTMLEditorKit) editor.getEditorKit();
         Document doc = editor.getDocument();
         StringReader reader = new StringReader(html);
         try {
              kit.read(reader, doc, location);
         } catch (BadLocationException e) {}
    //listen for actions being performed and process them
    public void actionPerformed(ActionEvent e) {
    //if the action is from the textfield (e.g. user hits enter)
         if (e.getActionCommand().equals(textFieldString)) {
              JTextField fromUser = (JTextField)e.getSource();
         if (fromUser != null){
    //place user text in editor pane
    //send message to server
                   if (userName.getText() != null) {
                        userString = userName.getText().trim();
                   out.println(userString + ": " + fromUser.getText());
              fromUser.setText("");
         } else if(e.getActionCommand().equals(connectString)) {
              CONNECTFLAG = true;
    } else if (e.getActionCommand().equals(loadgraphicString) ) {
              final JFileChooser fc = new JFileChooser();
              int returnVal = fc.showOpenDialog(this);
              if (returnVal == JFileChooser.APPROVE_OPTION) {
                   File file = fc.getSelectedFile();
                   dPanel.loadImage(file.getAbsolutePath());
                   sendImage(file);
         else if (e.getActionCommand().equals(fontlist)){
         JComboBox cb = (JComboBox)e.getSource();
    String newSelection = (String)cb.getSelectedItem();
    currentFont = newSelection;
         userString = currentFont;
    return;
    /*public void itemStateChanged (ItemEvent e) {
    if ( e.getStateChange() != ItemEvent.SELECTED ) {
    return;
    if ( list == fontlist ) {
    fontchoice = (String)fontlist.getSelectedItem();
         userString.changeFont(fontchoice);
    //append text to the editor pane and put it at the bottom
    public static void appendText(String text) {
         if (text.startsWith("ID ") ) {
              userString = text.substring(3);
         } else if (text.startsWith("DRAW ") ) {
              if (text.regionMatches(5,"LINE",0,4)) {
    dPanel.processLine(text);
         }else if (text.regionMatches(5,"POINTS",0,5)) {
         dPanel.processPoint(text);
         } else if (text.startsWith("IMAGE ") ) {
    int len = (new Integer( text.substring(6, text.indexOf(",")))).intValue();
    //get x and y coordinates
         byte[] data = new byte[ (int)len ];
         int read = 0;
    try {
         while (read < len) {
         data = text.getBytes( text.substring(0, len) );
    } catch (Exception e) {}
         Image theImage = null;
         theImage = dPanel.getToolkit().createImage(data);
         dPanel.getToolkit().prepareImage(theImage, -1, -1, dPanel);
         while ((dPanel.getToolkit().checkImage(theImage, -1, -1, dPanel) & dPanel.ALLBITS) == 0) {}
              dPanel.drawPicture(0, 0, theImage);
    } else {
    //set current position in editorPane to the end
              editorPane.setCaretPosition(editorPane.getDocument().getLength());
    //put text into the editorPane
              try {
                   insertTheHTML(editorPane, text, editorPane.getDocument().getLength());
              } catch (IOException e) {}
    } //end of appendText(String)
    public void sendImage(File file) {
    //find length of file
         long len = file.length();
    //read file into byte array
         byte[] byteArray = new byte[(int)len];
         try {
              FileInputStream fstream = new FileInputStream(file);
              if (fstream.read(byteArray) < len) {
    //error could not load file
              } else {
              out.println("IMAGE " + len + ",");
                   out.write(byteArray, 0, (int)len); //write file to stream
         } catch(Exception e){}
    //run the client
    public static void main(String[] args) {
         String ipAddr=null, portNr=null;
              if (args.length != 2) {
                   System.out.println("USAGE: java guiClient IP_Address port_number");
                   System.exit(0);
              } else {
         ipAddr = args[0];
              portNr = args[1];
              JFrame frame = new guiClient();
              frame.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) { System.exit(0); }
              frame.pack();
              frame.setVisible(true);
              while(CONNECTFLAG == false){}
    //sames as previous client,
    //set up connection and then listen for messages from the Server
              String socketIP = ipAddr;
              int port = Integer.parseInt(portNr);
    //the IP address of the machine where the server is running
              Socket theSocket = null;
    //communication line to the server
              out = null;
    //for message sending
              BufferedReader in = null;
    //for message receiving
              try {
              theSocket = new Socket(socketIP, port );
    //try to connect
              out = new PrintStream(theSocket.getOutputStream());
                   dPanel.out = out;
    //for client to send messages
              in = new BufferedReader(new InputStreamReader(theSocket.getInputStream()));
                   BufferedReader userIn = new BufferedReader(new InputStreamReader(System.in));
                   String fromServer;
                   while ((fromServer = in.readLine()) != null) {
                   appendText(fromServer);
                   if (fromServer.equals("BYE")) {
                        appendText("Connection Closed");
                        break;
              out.close();
    //close all streams
              in.close();
              theSocket.close();
    //close the socket
         } catch (UnknownHostException e) {
    //if the socket cannot be openned
              System.err.println("Cannot find " + socketIP);
              System.exit(1);
              } catch (IOException e) { //if the socket cannot be read or written
              System.err.println("Could not make I/O connection with " + socketIP);
              System.exit(1);
    class HyperListener implements HyperlinkListener {
    public JEditorPane sourcePane;
    public void hyperlinkUpdate(HyperlinkEvent e) {
    if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
    sourcePane = (JEditorPane) e.getSource();
                   if (e instanceof HTMLFrameHyperlinkEvent) {
    HTMLFrameHyperlinkEvent event = (HTMLFrameHyperlinkEvent) e;
                        System.out.println(event.getTarget());
                        HTMLDocument doc = (HTMLDocument) sourcePane.getDocument();
                        doc.processHTMLFrameHyperlinkEvent(event);
    else {
    try {}
    catch (Exception ev){
         ev.printStackTrace();
    Well sorry the source code takes up the whole forum but I need a good feedback from this.

    All right...
    public class guiClient extends JFrame implements ActionListener {
    static String userString;
    static String currentFont;
    String fontchoice;
    String fontlist;
    static JTextField userName = new JTextField();
    public guiClient() {
         super("My Client");
    public guiClient() {
         super("My Client");
    // Create a ComboBox
    GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
    String envfonts[] = gEnv.getAvailableFontFamilyNames();
    Vector vector = new Vector();
    for ( int i = 1; i < envfonts.length; i++ ) {
    vector.addElement(envfonts);
    JComboBox fontlist = new JComboBox (envfonts);
         fontlist.setSelectedIndex(0);
         fontlist.setEditable(true);
         fontlist.addActionListener(this);
         fontchoice = envfonts[0];     
    //Create a regular text field.
         JTextField textField = new JTextField(10);
         textField.setActionCommand(textFieldString);
         textField.addActionListener(this);
    public void actionPerformed(ActionEvent e) {
    //if the action is from the textfield (e.g. user hits enter)
         if (e.getActionCommand().equals(textFieldString)) {
              JTextField fromUser = (JTextField)e.getSource();
         if (fromUser != null){
    //place user text in editor pane
    //send message to server
                   if (userName.getText() != null) {
                        userString = userName.getText().trim();
                   out.println(userString + ": " + fromUser.getText());
              fromUser.setText("");
         else if (e.getActionCommand().equals(fontlist)){
         JComboBox cb = (JComboBox)e.getSource();
    String newSelection = (String)cb.getSelectedItem();
    currentFont = newSelection;
         userString = currentFont;
    return;

  • Make a read-only text field open by using button and javascript

    Hello
    I have a form with text fields that I will pre-populate with data. The text fields will be read-only by default. I want to make it so that when a user wants to make edits, he will need to click on a button and in turn, the text field's background will turn gray and he can make edits to the text field. I can already make the background turn gray but I cannot make the text field open.
    This is the code that will run after the button is clicked:
    color.ltGray = new Array("G", 0.75);
    this.getField('TestField').fillColor = color.ltGray;
    this.getField('TestField').access = "open";
    The text field's background turns gray but it is still read-only. Any ideas?
    Thanks in advance!

    Here's the online version of the Acrobat JavaSript documentation: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/wwhel p.htm?href=JavaScript_SectionPage.70.1.html&accessible=true
    It's also available as a PDF in the Acrobat SDK.
    Regarding your other question about adding a PDF to another, do you want to add it as an attachment, or add the pages from one PDF to another?

  • How to display the content of a BLOB column in a ADF/BC pages ?

    How to display the content of a BLOB column in a ADF/BC pages ?
    There is some image in database table blog column. And we want to display image on the screeen.
    There is some example about upload and dowload blog columns.
    (steve not yet document example page etc...)
    But We want to display blog picture in a image component...
    is there any basic way to do it ?
    Thanks a lot...

    Ali,
    You could just download the sample app... but... here is the servlet code from the demo (look at it just for technique - you'll obviously have to change it for your needs)...
    John
    package oracle.fodemo.storefront.servlet;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.ViewObject;
    import oracle.jbo.client.Configuration;
    import oracle.jbo.domain.BlobDomain;
    import oracle.jbo.domain.DBSequence;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.ViewObjectImpl;
    public class ImageServlet
      extends HttpServlet
      private static final String CONTENT_TYPE =
        "image/jpg; charset=windows-1252";
      public void init(ServletConfig config)
        throws ServletException
        super.init(config);
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response)
        throws ServletException, IOException
        response.setContentType(CONTENT_TYPE);
        response.setContentType(CONTENT_TYPE);
        String detailProductId = request.getParameter("detail");
        String thumbnailProductId = request.getParameter("thumbnail");
        boolean thumbnail = true;
        String productId = null;
        OutputStream os = response.getOutputStream();
        String amDef = "oracle.fodemo.storefront.store.service.StoreServiceAM";
        String config = "StoreServiceAMLocal";
        ApplicationModule am =
          Configuration.createRootApplicationModule(amDef, config);
        ViewObjectImpl vo =
          (ViewObjectImpl) am.findViewObject("ProductImages"); // get view object (the same as used in the table)
        if (detailProductId != null)
          productId = detailProductId;
          thumbnail = false;
        else
          productId = thumbnailProductId;
        vo.defineNamedWhereClauseParam("paramThumbnail", null, null);
        vo.defineNamedWhereClauseParam("paramProductId", null, null);
        vo.setWhereClause("DEFAULT_VIEW_FLAG = :paramThumbnail AND PRODUCT_ID = :paramProductId");
        vo.setNamedWhereClauseParam("paramThumbnail", (thumbnail? "Y": "N"));
        vo.setNamedWhereClauseParam("paramProductId", productId);
        vo.executeQuery();
        Row product = vo.first();
        BlobDomain image = (BlobDomain) product.getAttribute("Image");
        InputStream is = image.getInputStream();
        // copy blob to output
        byte[] buffer = new byte[10 * 1024];
        int nread;
        while ((nread = is.read(buffer)) != -1)
          os.write(buffer, 0, nread);
        os.close();
        vo.setWhereClause(null);
        vo.removeNamedWhereClauseParam("paramProductId");
        vo.removeNamedWhereClauseParam("paramThumbnail");
        Configuration.releaseRootApplicationModule(am, false);
    }

Maybe you are looking for

  • I am trying to have some LabVIEW code called in a New thread exit when the testStand sequence terminates

    I have a Sequence that launches a sequence in a New Thread that happens to launch some LabVIEW code.  The problem is when the LabVIEW code finishes, it will not close even when the TestStand sequence terminates. Is there a way to tell this LabVIEW co

  • Can you install windows from a back up file on external hard drive?

    I originally received Windows 7 Professional from a friend who was in computer sciences at the local university and received free software as a perk. It was downloaded and burned onto a disc, which she loaned to me so I could use it with Bootcamp. Th

  • Dynamic Select List Allowed Values

    Howdy Folks, I am trying to allow end users to select their username. The usernames are generated from a rule library, and displayed in a select form element. I am doing this by having the allowedValues call the rule that generates the possible names

  • File Vault Log-Out - How do I get rid of...

    Hello All, I have file vault turned on and every time I log-out I get a message prompting me to "free up disk space" in my my documents directory. Is there any way to turn off this feature? Thanks everybody...

  • SunPKCS11 provider - write key on a  SmartCard

    I use provider SunPKCS11 and without any troubles I can read certificates and key from the cryptographic card, but every attempt of writing anything on the card results with an error during setKeyEntry method call: -Example---------------------------