JTextArea - Text is not starting on a new line

Hi,
I would like the text when set in the JTextArea to start a new line however the new line code is not working please can anyone suggest a reason why this may be.
private final static String newline = "\n";
chatTxtArea.setColumns(20);
        chatTxtArea.setEditable(false);
        chatTxtArea.setLineWrap(true);
        chatTxtArea.setRows(5);
        jScrollPane1.setViewportView(chatTxtArea);
public void responseText(String username, String txt)
        chatTxtArea.setText(username.toUpperCase()+" Says: "+txt+newline);
        chatTxtArea.setCaretPosition(chatTxtArea.getDocument().getLength());
    }Many Thanks

Hi,
Thanks for your reply.
At the moment the 'txt' and 'username' go into the
responseText method and is displayed in the
chatchatTxtArea correctly however when a new message
is sent it does not start on a new line instead it
just replaces the previous line of text.
So i believe the rest of the code is working. I
believe the problem occurs either where i have set up
the JTextArea or i am using the new line
incorrectly.
ThanksBecause you are calling setText(String). Use the append(String) method of JTextArea instead.
~Tim

Similar Messages

  • Text does not move to a new line, I have to scroll to the right???

    In Safari and Firefox browsers when looking at some webpages the text is one long line and I have to scroll to the right to read everything. How do I restore the text so it goes down instead of across?
    I searched for wrap text but could not find anything.
    Thank You

    Hi M'Q', Welcome Back.
    It seems to be site formatting. I get it all the time in these forums when someone posts a crash log. The lines don't wrap and spread it out sideways.
    My WAG; we just have to live with it. :~(

  • Property List error: Unexpected character b at line 1 / JSON error: JSON text did not start with array or object and option to allow fragments not set.

    Hi,
    I have a MBP 13' Late 2011 and Yosemite 10.10.2 (14C1514).
    Until yesterday, I was using Garmin ConnectIQ SDK and all was working fine.
    Yesterday, I've updated my system with latest security updates and Xcode updates too (Version 6.2 (6C131e)).
    Since, I can't launch the ConnectIQ simulator app, I have this message in console :
    8/04/2015 15:19:04,103 mds[38]: There was an error parsing the Info.plist for the bundle at URL Info.plist -- file:///Volumes/Leto/connectiq-sdk-mac-1.1.0_2/ios/ConnectIQ.bundle/
    The data couldn’t be read because it isn’t in the correct format.
    <CFBasicHash 0x7fa64f44e9a0 [0x7fff7dfc7cf0]>{type = immutable dict, count = 2,
    entries =>
      0 : <CFString 0x7fff7df92580 [0x7fff7dfc7cf0]>{contents = "NSDebugDescription"} = <CFString 0x7fa64f44f0a0 [0x7fff7dfc7cf0]>{contents = "Unexpected character b at line 1"}
      1 : <CFString 0x7fff7df9f5e0 [0x7fff7dfc7cf0]>{contents = "kCFPropertyListOldStyleParsingError"} = Error Domain=NSCocoaErrorDomain Code=3840 "The data couldn’t be read because it isn’t in the correct format." (Conversion of string failed.) UserInfo=0x7fa64f44eda0 {NSDebugDescription=Conversion of string failed.}
    I have looked at this file and it looks like a binary plist
    bplist00ß^P^V^A^B^C^D^E^F^G^H
    ^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_ !"$%&'()'+,^[\CFBundleNameWDTXcodeYDTSDKName_^P^XNSHumanReadableCopyrightZDTSDKBuild_^P^YCFBundleDevelopmentRegion_^P^OCFBundleVersi    on_^P^SBuildMachineOSBuild^DTPlatformName_^P^SCFBundlePackageType_^P^ZCFBundleShortVersionString_^P^ZCFBundleSupportedPlatforms_^P^]CFBundleInfoDictionaryVersion_^P^RCFBundleE    xecutableZDTCompiler_^P^PMinimumOSVersion_^P^RCFBundleIdentifier^UIDeviceFamily_^P^QDTPlatformVersion\DTXcodeBuild_^P^QCFBundleSignature_^P^ODTPlatformBuildYConnectIQT0611[iph    oneos8.1o^P-^@C^@o^@p^@y^@r^@i^@g^@h^@t^@ ^@©^@ ^@2^@0^@1^@5^@ ^@G^@a^@r^@m^@i^@n^@.^@ ^@A^@l^@l^@ ^@r^@i^@g^@h^@t^@s^@ ^@r^@e^@s^@e^@r^@v^@e^@d^@.V12B411RenQ1V14C109Xiphoneos    TBNDLS1.0¡#XiPhoneOSS6.0YConnectIQ_^P"com.apple.compilers.llvm.clang.1_0S8.1_^P^Tcom.garmin.ConnectIQ¡*^P^AW6A2008aT????^@^H^@7^@D^@L^@V^@q^@|^@<98>^@ª^@À^@Ï^@å^A^B^A^_^A?^AT^    A_^Ar^A<87>^A<96>^Aª^A·^AË^AÝ^Aç^Aì^Aø^BU^B\^B_^Ba^Bh^Bq^Bv^Bz^B|^B<85>^B<89>^B<93>^B¸^B¼^BÓ^BÕ^B×^Bß^@^@^@^@^@^@^B^A^@^@^@^@^@^@^@-^@^@^@^@^@^@^@^@^@^@^@^@^@^@^Bä
    I guess it is a normal format but my system seems to be unable to read binary plist ?
    I tried some stuff with plutil
    plutil -lint Info.plist
    Info.plist: Unexpected character b at line 1
    Same for convert
    plutil -convert xml1 Info.plist
    Info.plist: Property List error: Unexpected character b at line 1 / JSON error: JSON text did not start with array or object and option to allow fragments not set.
    I also try to download a fresh version of the connectIQ SDK and no changes.
    Any idea ?
    Thanks

    Step by step, how did you arrive at seeing this agreement?

  • "Layer 1 does not start with a new cell" replicator error

    Hi All,
    I recently sent a dual layer +R DVD off to our replication house and their system is returning a message that says: "Layer 1 of DVD-Video does not start with a new cell".
    I know from reading that the dual-layer breakpoint must be set to the end of a cell, but what does the word "cell" translate into for DVDSP4?
    I had the DVD DL+R set to Automatic and Non-Seamless for output for the break point. Should I just try setting the break point manually at the beginning or ending of a track that would be dubbed as just a little more than half the size of the content? (I know in OTP, the Layer 0 has to be bigger than Layer 1)
    Please Help!
    Cheers,
    Dusty

    Thanks both of you for your replies.
    Eric, I am currently exporting DDPs to send in to the replicator. I also emailed them asking if they accept this format for delivery. (Which I would hope they would, as it is, an answer to DLT of sorts) Thanks for bringing this up, DDP is new to me, as this is our first DL project for replication.
    Drew, to answer your reply, yes I have two viable markers (chapter markers) that show up in black, not grayed out, in the tab you mentioned under formatting. I chose manual break point selection for this last disc I burned and chose chapter 4 of that track. (chapter 4 and chapter 5 of track 6 are only options) I have to assume that the "automatic" setting was selecting chapter 5, as it had to see that as the last viable marker available to select, as described in the DVDSP4 manual.
    DVDSP4 says that all markers are considered cells- Or actually that tracks are cells and that the markers within them make up more cells. So my question, outside of DDP option, would be, "what truly constitutes a cell boundary in DVDSP4?" Is it the markers within the tracks or the beginning or ends of the tracks themselves?
    As a side note, I burned the disc that received the error, "Layer 1 doesn't start with a new cell" from an IMG i created from DVDSP4 through Disk Utility. Word is that IMG's somehow don't include breakpoint information.
    So at this point I don't know if it is the IMG or the fact that DVDSP4 wants the break at one of two possible chapter markers in track 6.
    (Some more background- this is a TV show season DVD, with thirteen tracks of video, each with 12-14 chapter markers a piece.)
    Any more thoughts to help clear the air on what constitutes a true new cell boundary?
    Thanks sooo much Eric and Drew, I know this a long read.
    Cheers,
    Dusty

  • Using dbms_lob append to insert text how do you insert a new line inbetween

    DBMS_LOB.APPEND (P_TEXT,'* Operator Phone,');
    ---- inbetween I need to insert new I am using DBMS_LOB.APPEND (P_TEXT,CHR(10)); IS there amy better method?
    DBMS_LOB.APPEND (P_TEXT,'* Operator Email Address,');

    Sorry if the question was not clear ---
    Lets say in the folowing example every write append needs to start on a new line followed by text. How do we do that?
    Do we add another writeappend(cvar,22, chr(10)); inbetween?
    dbms_lob.writeappend(cvar, 19, '<root><book><title>');
    dbms_lob.writeappend(cvar, length(r.title), r.title);
    dbms_lob.writeappend(cvar, 14, '</title><desc>');
    dbms_lob.writeappend(cvar, length(r.description), r.description);
    dbms_lob.writeappend(cvar, 27, '</desc></book><author_name>');
    dbms_lob.writeappend(cvar, length(r.author_name), r.author_name);
    dbms_lob.writeappend(cvar, 21, '</author_name></root>');
    Edited by: user521218 on May 7, 2009 12:34 PM

  • Purchasing Groups not defaulting to all new line items

    Hi,
    We are on SRM 4.0. currently, we can only assign a user to one purchasing group.Now my problem is Purchasing Groups not defaulting to all new line items (when changed in default settings).If any one faced this problem help me out.
    regards,
    sobhan

    Sobhan,
    Depending on your material group, the purchaing group will be defaulted. According to the responsibility tab and SPRO Config define objects in the backend system, the purchaing group will default in your basic data of the shopping cart screen.
    Even though in your default settings you will assign a Purchaing group, the purchasing group will be defaulyed on the basis of the above two crietrias mentioned.
    Please assigbn points for usefull answer !!
    Sundeep

  • Windows could not start DBConsole for new database instance

    Hi,
    I am getting this error "Windows could not start the OracleDBConsoleOracleInstance2 on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the system vendor, and refer to service-specific error code 1".
    I installed Oracle 11g on Windows 7 and created my 1st database instance (oracleInstance1) successfully with a listener and service configured. I could access this database using DBconsole URL: https://hostname:1158/em.
    I see the services started for:
    OracleDBConsoleOracleInstance1
    OracleOraDb11g_home1TNSListener
    OracleServiceOracleInstance1
    Next, I created a second database instance (oracleInstance2) and have configured a new service for this database. I am using the same listener as I intend to use one database instance at any point of time.
    However, I got this warning message during configuration:
    "Enterprise manager configuration succeeded with the following warning - Error starting Database Control. Please execute the following command(s).
    1. Set the environment variable ORACLE_UNQNAME to Database unique name.
    2. C:\Oracle\product\11.2.0\dbhome_1\bin\emctl.bat start dbconsole"
    To start the new database console, I stopped the previously running DBConsole, OracleDBConsoleOracle1 and started the new DBConsole OracleDBConsoleOracle2 and get the above error.
    When I try to start dbconsole manually using "emctl dbconsole start", it starts OracleDBConsoleOracle1 instead.
    I changed environment variables ORACLE_SID=oracle2 and ORACLE_UNQNAME=oracle2
    What am I missing here. Please help!
    Thank you.

    968952 wrote:
    Hi,
    I am getting this error "Windows could not start the OracleDBConsoleOracleInstance2 on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the system vendor, and refer to service-specific error code 1".
    I installed Oracle 11g on Windows 7 and created my 1st database instance (oracleInstance1) successfully with a listener and service configured. I could access this database using DBconsole URL: https://hostname:1158/em.
    I see the services started for:
    OracleDBConsoleOracleInstance1
    OracleOraDb11g_home1TNSListener
    OracleServiceOracleInstance1
    Next, I created a second database instance (oracleInstance2) and have configured a new service for this database. I am using the same listener as I intend to use one database instance at any point of time.
    However, I got this warning message during configuration:
    "Enterprise manager configuration succeeded with the following warning - Error starting Database Control. Please execute the following command(s).
    1. Set the environment variable ORACLE_UNQNAME to Database unique name.
    2. C:\Oracle\product\11.2.0\dbhome_1\bin\emctl.bat start dbconsole"
    To start the new database console, I stopped the previously running DBConsole, OracleDBConsoleOracle1
    Why?
    and started the new DBConsole OracleDBConsoleOracle2 and get the above error.
    When I try to start dbconsole manually using "emctl dbconsole start", it starts OracleDBConsoleOracle1 instead.
    I changed environment variables ORACLE_SID=oracle2 and ORACLE_UNQNAME=oracle2
    What am I missing here. Please help!First thing you are missing is showing us what you did. Instead you just described it, and that leaves a lot of room for questions. Copy and paste from a command prompt can work wonders here.
    From a command prompt, enter the following:
    set ORACLE_SID=oracle2
    set ORACLE_UNQNAME=oracle2
    set | sort
    net start
    emctl start dbconsolecopy the entire session, commands and full responses, and paste back here.
    >
    Thank you.Just to take a side road ...
    "I am using the same listener as I intend to use one database instance at any point of time. "
    Doesn't' matter if you use one instance or 100. The listener was DESIGNED to service multiple instances of multiple versions running from multiple homes. It is nothing but a connection broker. A telephone switchboard, if you will. All you need is a single listener, with the default name of LISTENER, running on the default port of 1521. It will handle all the database instances you care to throw at it. More instances than anyone in their right mind would ever put on a single server. Your server will run out of capacity to host additional instances before the listener runs out of capacity to service them. Especially since your 'server' is really just a toy in the Oracle world.

  • External startup disks will not start with my new iMac

    My external devices which are startup disks will not start when connected to my iMac, although it appears in the bootable drive selections after the chime sound, using the option (Alt) key. I get the bootable drive selections and when selecting it all I get is a gray screen with the apple logo and that is it. No matter how long I wait the start up does not happen. I am sure that the external device is not damaged because there is no problem to use it as a startup device when connected to my MacBook Pro.
    Otherwise the devices work as they should. If I connect them to my iMac then they will appear on the desktop, etc. The only thing which does not work is that they cannot be used as startup disks, even though they work fine as startup disks if connected to my MacBook Pro.

    Based on your description it is very hard to tell what is going on.
    You appear to have an i7 iMac. That model was delivered with Snow Leopard (10.6.x).
    My guess is that your external disks may have a version of OS X that predates the version supplied with your new iMac. You cannot run an earlier version of OS X than what was delivered with your Mac.

  • My predictive text does not work since the new update

    The "predictive text" does not work on y IPod 4g since the new software update.  How do I fix it?

    As a Test:
    Hold down the option (or alt) key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?
    Post back with the result.

  • CLI156 Could not Start the domain - new session

    Hi,
    I'm trying to start my doamin but get the following message:
    Starting Domain domain1, please wait.
    Log redirected to C:\Sun\AppServer\domains\domain1\logs\server.log.
    Could not create temporary files - check C:\DOCUME~1\&#915;&#8734;&#8805;&#960;\LOCALS~1\Temp\ to see
    if its writeable and not-full
    CLI156 Could not start the domain domain1.
    I guess the problem is with the library name in hebrew. But I don't know where can I change the path for the temporary files.
    Can anyone help?
    Thanks,
    Gilad

    Specify TempDir directive in your server's instance_dir/config/init.conf file.
    Syntax is:
    TempDir path
    Or change environment's TEMP variable. Application server uses this variable for temp files writing by default.

  • Text file - carriage return, creating a new line

    anyone know how to create a new line in a text file, something which is the text file equivelent of a BR (html) tag.

    in windows it's "\r\n"
    in linux/unix/bsd it's "\n"
    but the best way to do it is
    //this will return the newline character for whatever
    //platform your program is running on
    System.getProperty("line.separator");

  • Laptop does not start with a new hdd

    I apologize for my English, I communicate through an interpreter.
    on my laptop hard drive broke. exchange rate fell to a sad zero.
    decided to replace with a new Seagate st320lm010, but encountered a problem:
    with the new drive laptop refuses to run, although on a different model laptop this drive worked just fine.after starting the bottom of the screen displayed message "press the Esc for startup"
    I need advice on how to fix it.

    possible difficulties of translation ... I can not run the laptop with a new hard drive! generally. inclusion in the notebook is displayed inscription "Press the Esc for startup" and nothing else does not produce any action. he wont want to run or boot menu or bios

  • Final Cut not starting up on new computer

    I recently had my computer stolen. I had installed final cut hd on that computer which was stolen. I replaced the computer and installed Final Cut Express HD on the new one.
    Now, when I try to open final cut express, it starts to open, and then it stops and does not open.
    Can anyone advise me on what to do?
    I'm on an iMac OX 10.4.10
    Memory 1 GB 667 MHz DDR2 SDRAM
    Processor 2.16 GHz Intel Core Duo 2

    Hi, Is that an upgrade, you are trying to install and not the original program?
    Sorry to hear about you having your laptop stolen. Would not like that one bit.All Dave

  • Can i use itunes to sync my iphone with another iphone. Both phones are iphone 4, I would like to recreate my old phone in my one. in other words; transfer my pictures, texts, contacts, notes ect onto my newer phone.

    hi, I have 2 iPhone 4 and i would like to transfer all of my documents and data, contacts, apps ect ect from my old phone to my new iPhone 4.
    Essentialy I would like to recreate my old phone on the new one. (older phone is scratched). I have a different phone number, and different i tunes account associated with each phone but I have no problem with changing the i tunes account on the new phone back to the account I had on the old one.
    I have done back ups in the past of my old phone, using i tunes and I would like to apply the backed up information to my new phone. How would I do this?
    Can I restore device A onto device B?  Also wondering what sort of information or files might not transfer?
    Thanks!

    The following link has instructions on how to transfer to a new device using iTunes (see the section below the "Use iCloud backup" section: http://support.apple.com/kb/HT2109

  • Owerbook g4 not starting up after new hard drive and software update

    Hello,
    I know that there are several postings that are similliar to this query, but none have answered my question.
    I have a Powerbook g4 15 inch 1.67/1.5 Ghz with 1 gig of Ram.
    A few months ago I suddenly found myself unable to log into my computer after trying to render an effect on Final Cut.  After going through Disk Utilities and repairing the Hard drive, the computer seemed to work for a day or so, but then ran into the same problem.  This time Disk Utilities found
    Keys out of order
    rebuilding catalog B-tree
    I feared the worst and replaced my hard drive with a Seagate PATA 2.5" Internal Notebook Drive.  Installed OS 10.4 and everything seemed dandy until I tried to re-install Final Cut, which would not allow me to install Live Type.  I remembered that there were some updates for livetype and OS X, so I tried updating the OS X dual update, which got about 90% of the way and then the Kernal Panic display told me to restart the computer.  Okay, this time the computer would hang in the gray apple screen for awhile and then the screen would turn blue.  Ran disk utilities off of the start up disk, and ran into the same B-tree problems (I'm guessing the directory is still damaged somehow).  
    So I erased and installed OS X again, and after that tried updating OS X, and the same thing happened.  Although this time disk utilities says the hard drive is OK.  Tried resetting PMU, fsck, PRAM, and still the blue screen after initial gray apple screen. Tried safe-mode, but it went to a single user "welcome to Darwin" screen and I didn't know what to do after that.
    So, should I try to erase and install again, this time running a repair permission before updating software?  ANY other ideas?  It seems like a directory issue, but I don't know what else to do.

    supersonicavengers:
    So, should I try to erase and install again, this time running a repair permission before updating software?
    If you do not have anything on the HDD you need to preserve, that is probably a good idea. Here's how I would proceed:
    Formatting, Partitioning Erasing a Hard Disk Drive
    Warning! This procedure will destroy all data on your Hard Disk Drive. Be sure you have an up-to-date, tested backup of at least your Users folder and any third party applications you do not want to re-install before attempting this procedure.
    • With computer shut down insert install disk in optical drive.
    • Hit Power button and immediately after chime hold down the "C" key.
    • Select language
    • Go to the Utilities menu (Tiger) Installer menu (Panther & earlier) and launch Disk Utility.
    • Select your HDD (manufacturer ID) in left side bar.
    • Select Partition tab in main panel. (You are about to create a single partition volume.)
    • Click on Options button
    • Select Apple Partition Map (PPC Macs) or GUID Partition Table (Intel Macs)
    • Click OK
    • Select number of partition in pull-down menu above Volume diagram.
    (Note 1: One partition is normally preferable for an internal HDD.)
    • Type in name in Name field (usually Macintosh HD)
    • Select Volume Format as Mac OS Extended (Journaled)
    • Click Partition button at bottom of panel.
    • Select Erase tab
    • Select the sub-volume (indented) under Manufacturer ID (usually Macintosh HD).
    • Check to be sure your Volume Name and Volume Format are correct.
    • Click Erase button
    • Quit Disk Utility.
    Installation Process
    While still booted from the install disk
    • Open Installer and begin installation.
    • Select installation option
    • Choose to Customize and deselect Foreign Language Translations and Additional Printer drivers.
    Optional: Check box to install X11 (Tiger and later) BSD Subsystems (Panther & earlier).
    • Proceed with installation.
    • After installation computer will restart for setup.
    • After setup, reboot computer.
    • Go to Applications > Utilities > Disk Utility.
    • Select your HDD (manufacturer ID) in left side bar.
    • Select First Aid in main panel.
    • Click Repair Disk Permissions.
    • Connect to Internet.
    • Download and install Mac OS X 10.4.11 Combo update (PPC) (Tiger)
    Computer will restart.
    • Repair Disk Permissions as previously.
    • Go to Apple Menu > Software Update.
    • Install all updates.
    Computer may restart after updates.
    • Go to Applications > Utilities > Disk Utility.
    • Select your HDD (manufacturer ID) in left side bar.
    • Select First Aid in main panel.
    • Click Repair Disk Permissions.
    Please do post back with questions or comments.
    cornelius

Maybe you are looking for

  • Output at a specific time

    Hi Gurus, I have a conditioin where the user intends to Print a out put for few billing types at 4: 0 Clock. After lot of analysis i have come up with a suitable solution that is 1) In the  condition record VV31 mention dispatch time = 3, i.e through

  • Can't boot up - damaged hard drive?

    I've put all info here so hope it helps - 3 questions at bottom. My system: iMac G4 800MHz 80GB HD can't remember how much RAM but I think I'd put the max possible in it. Mac os: 10.4.11 partitioned for 0SX and classic 9.9.2 (approx split 90%/10%) Th

  • Bookmarks not syncing across devices

    My iBook bookmarks have stopped syncing between my iPhone 4 and iPad 2. I have tried turning the syncing off and on in settings but still no luck.....anyone have any ideas as it's driving me nuts ?????

  • After installing Acrobat/Reader on Windows 7 or Vista, icons of all applications/file-types change t

    After installing Acrobat/Reader on Windows 7 or Vista, icons of all applications/file-types change to Acrobat/Reader icon and double clicking on any icon/file launches Acrobat/Reader (instead of the native application associated to the file type). Is

  • Can I make a copy of an AdvancedDataGrid Item Renderer?

    I have manual drag-and-drop functionality built in to my AdvancedDataGrid (ADG). Right now, I am building my own custom drag proxy using a Container instance and grabbing the text to use from the "selectedItem" property. This creates a suitable image