Creating word processor gui question

Hi
I'm trying to create a word processor gui and I'm new to Java so I'm very new to working with guis. I'm trying to create a menu bar and use Jtextarea so that the user would be able to type in multiple lines of text. I'm completely confused with how to do bc I've been trying and trying but seem to have a problem with my main class and my default constructor. any tips on how to get started?
my main class looks like this {
WordProcessorDemo f = new WordProcessorDemo();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.pack();
f.setVisible(true);
f.setSize(800, 600);
f.setTitle("Word Processor");}
and it gives me this error msg :
java.lang.IllegalArgumentException: illegal component position
     at java.awt.Container.addImpl(Container.java:325)
     at java.awt.Container.add(Container.java:252)
     at javax.swing.JMenu.add(JMenu.java:511)
     at wordprocessor.WordProcessorDemo.<init>(WordProcessorDemo.java:62)
     at wordprocessor.WordProcessorDemo.main(WordProcessorDemo.java:18)

That code is not causing the problem. Look at line 62 in your constructor
at wordprocessor.WordProcessorDemo.<init>(WordProcessorDemo.java:62)
You are adding something to a JMenu
at javax.swing.JMenu.add(JMenu.java:511)
and it's not liking your parameters or something

Similar Messages

  • How can i do the word processor's page operations in my java word processor

    Hai,
    I am developing a word processor using Java. It�s workspace is JTextPane. In order to give the page view and do page operation I have assigned one JTextPane per page.
    Generaly in a word processor if the cursor completes a page, a new page will be created and the cursor will be fixed in the starting position of the new page.
    I need to do the same thing in my word processor.
    That is I need to restrict the JTextPane(page) in such a way that the cursor has to be always inside the JtextPane. It means that the JTextPane (page) should not increase it�s size whenever the cursor goes out of it�s size. Instead a new JTextPane(page) can be created and the cursor can be fixed in starting position of the new JTextPane.
    Thing is that a text component can be added with or without the JScrollPane. In the first case both the scroll bar and the cursor will appear if it goes out of the text component�s rage. In the second case neither scroll bar nor cursor will appear. So these two will not help me.
    How can I do this in my word processor?
    I will be grateful to you if you send some suggestion.
    With regards,
    K. Saran

    Hi,
    this is not an answer to our question, sorry.
    I'm fairly new to Java but is working on a projec similar to yours. I always use other code to learn how new parts of java works. Haven't been able to find any examples of initializing JTextPanes though. Any chance of you posting some here?
    Would be much appriciated.
    Alternatively: do u know a site where u can find such examples??
    Kind Regards
    Thomas

  • Is there a good but free word processor that's Mac compatible?

    I don't know where else this question would belong so I just put it here. So, my question is: Is thier a free (but decent) word processor that's Mac compatible that I can download off of the internet? I've already used up my free trial of "Pages" that came with my iMac. I'd also like it to be able to save and print off text documents and also be PC compatible as well.

    Hi, you already have Text Edit, I use BEAN//it's pretty good, but you can Google your requirements and there are quite a few "freebies"
    http://www.bean-osx.com/
    ...L

  • Create word document based on query in oracle reports

    Database version
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    PL/SQL Release 9.2.0.8.0 - Production
    CORE 9.2.0.8.0 Production
    TNS for HPUX: Version 9.2.0.8.0 - Production
    NLSRTL Version 9.2.0.8.0 - Production
    CREATE TABLE TAB1
    DEPT_ID NUMBER,
    DRIVE_ID CHAR(10 BYTE),
    QC_TYPE_ID CHAR(4 BYTE),
    QC_SUBTYPE_ID CHAR(4 BYTE),
    EQUIP_CODE VARCHAR2(20 BYTE),
    CREATE_TIME DATE
    Insert into TAB1
    (DEPT_ID, DRIVE_ID, QC_TYPE_ID, QC_SUBTYPE_ID, EQUIP_CODE,
    CREATE_TIME)
    Values
    (14, 'DRV5535359', '1011', '1012', 'HEMORYA070',
    TO_DATE('08/07/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TAB1
    (DEPT_ID, DRIVE_ID, QC_TYPE_ID, QC_SUBTYPE_ID, EQUIP_CODE,
    CREATE_TIME)
    Values
    (14, 'DRV5535359', '1011', '1012', 'HEMORYA089',
    TO_DATE('08/07/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TAB1
    (DEPT_ID, DRIVE_ID, QC_TYPE_ID, QC_SUBTYPE_ID, EQUIP_CODE,
    CREATE_TIME)
    Values
    (14, 'DRV5535359', '1011', '1014', 'SEALCEN007',
    TO_DATE('08/07/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TAB1
    (DEPT_ID, DRIVE_ID, QC_TYPE_ID, QC_SUBTYPE_ID, EQUIP_CODE,
    CREATE_TIME)
    Values
    (95, 'DRV2016629', '1008', '1012', 'HEMORYA124',
    TO_DATE('08/07/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TAB1
    (DEPT_ID, DRIVE_ID, QC_TYPE_ID, QC_SUBTYPE_ID, EQUIP_CODE,
    CREATE_TIME)
    Values
    (95, 'DRV2016629', '1008', '1012', 'HEMORYA125',
    TO_DATE('08/07/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TAB1
    (DEPT_ID, DRIVE_ID, QC_TYPE_ID, QC_SUBTYPE_ID, EQUIP_CODE,
    CREATE_TIME)
    Values
    (95, 'DRV2016629', '1008', '1013', 'SEALCEN032',
    TO_DATE('08/07/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TAB1
    (DEPT_ID, DRIVE_ID, QC_TYPE_ID, QC_SUBTYPE_ID, EQUIP_CODE,
    CREATE_TIME)
    Values
    (11, 'DRV5533643', '1011', '1012', 'HEMORYA099',
    TO_DATE('08/07/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TAB1
    (DEPT_ID, DRIVE_ID, QC_TYPE_ID, QC_SUBTYPE_ID, EQUIP_CODE,
    CREATE_TIME)
    Values
    (11, 'DRV5533643', '1011', '1026', 'HEMORYA100',
    TO_DATE('08/07/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into TAB1
    (DEPT_ID, DRIVE_ID, QC_TYPE_ID, QC_SUBTYPE_ID, EQUIP_CODE,
    CREATE_TIME)
    Values
    (11, 'DRV5533643', '1011', '1026', 'SEALCEN008',
    TO_DATE('08/07/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    COMMIT;
    Sample table and data
    Wanted help if any experts out there to help me create word output instead of pdf or excel format report
    select * from tab1;
    DEPT_ID|DRIVE_ID|QC_TYPE_ID|QC_SUBTYPE_ID|EQUIP_CODE|CREATE_TIME
    14|DRV5535359|1011|1012|HEMORYA070|8/7/2012
    14|DRV5535359|1011|1012|HEMORYA089|8/7/2012
    14|DRV5535359|1011|1014|SEALCEN007|8/7/2012
    95|DRV2016629|1008|1012|HEMORYA124|8/7/2012
    95|DRV2016629|1008|1012|HEMORYA125|8/7/2012
    95|DRV2016629|1008|1013|SEALCEN032|8/7/2012
    11|DRV5533643|1011|1012|HEMORYA099|8/7/2012
    11|DRV5533643|1011|1026|HEMORYA100|8/7/2012
    11|DRV5533643|1011|1026|SEALCEN008|8/7/2012
    Edited by: user_anumoses on Aug 23, 2012 1:20 PM

    Well, I know you've been asked before, but it seems you're either incapable or just plain lazy when it comes to helping us to help you. You haven't bothered to format your code using the appropriate tags, and you haven't provided all the information needed, and it looks like you haven't even bothered to post it in the correct forum (there's a forum specifically for Oracle Reports).
    I'll ask you once more to read this: {message:id=9360002}
    As best I know (and I haven't worked on Oracle reports for many years), it is only capable of producing PDF 'out of the box', so any other reporting format would need to be developed by yourself. You haven't even specified whether you're using client based reports or web based (application server) reports, and solutions could vary depending on that.
    Don't expect much help if you can't be bothered to follow simple guidelines in asking questions.

  • Creating a little GUI with adding DNS record functionality

    Hi all,
    Creating a DNS record (A record) is pretty straight forward in Powershell. I wonder if somebody knows how to create a little GUI with the powershell commands in the background to create DNS records.
    For example something like a HTML form in where u can enter the DNS name, the Zone and the IPv4 address. Click Add and Powershell will add it on the background. I cannot find any good information on this when i google on it.
    Thanks!

    Hi Bennekommer,
    I‘m writing to check if the suggestions were helpful, if you have any questions, please feel free to let me know.
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Word Processor for Panther

    Hi, I'm asking this question for my MIL who owns an older iBook with Panther.... Is there a way to get an older/compatible version of iWork for her machine at this point in time? Or is there another word processor program that we can try? Obviously, as it's been several years since she's had the iBook, she doesn't use such programs often, but she wants one now. The iWork that is available now is only for 10.4.10 and higher.
    Any suggestions welcomed!
    Thanks,
    Aviva

    You could look for a used copy of iWork '05 or '04 on eBay. Either should work with Panther. Or you could look for a copy of AppleWorks (PPC) which also works on that model with Panther.
    The commercial product, Papyrus, is an integrated productivity application that will work with Panther - VersionTracker or MacUpdate. There is also the free open source integrated suite, NeoOffice Aqua, that is available for PPC Macs and works with Panther or later. It is similar to MS Office.

  • Word processors

    i need a word processor for my mac, any suggestions

    Another free, open-source option, more evolved and Mac-like than OpenOffice, is LibreOffice. It reads, edits and saves documents in MS Office formats as well as its own, and it includes word, spreadsheet, presentation, drawing, database and formula processing capabilities.
    That said, I prefer using Apple's Pages ($20) whenever I don't need to create MS Office-compatible documents, i.e., whenever I'm writing something that I'll print instead of sharing it electronically with non-Mac users. (Pages does read, write and save in Word's file format, but complex document formatting doesn't translate very well.) A point in LibreOffice's favor is that I like the spreadsheet in LibreOffice better than Apple's Numbers, which I got with Pages and Keynote as part of the iWork package. (They're now available separately.)
    If your work will require frequent sharing of elaborately formatted documents with Windows-based users of MS Office, unfortunately you'll have to buy MS Word for the Mac to get the best possible compatibility and avoid losing formatting in the translation. Ever since the demise of Word 5.1a (must be 15 years now), I have loathed Word for always being certain that it knows better than I do what I want to type and write and constantly getting in my way. I can only imagine how much more obnoxious it would see if I weren't an excellent speller with a good command of grammar. Most infuriating is the fact that I've never been able to type a numbered or bulleted list of items in Word without having it laid out exactly the way Word thinks I should want it instead of the way I want it, no matter how many "features" I turn off.

  • Best option for a word processor for the G3 dual usb running Panther

    More and more I am coming to rely on my G3 for word processing tasks - particularly research notes and a personal journal.
    So far I've tried the simple text editor (quick but poor text on-screen), OpenOffice (being xwindow it's slow to load and slow to update screen) and AppleWorks (good display but no spell checker) -each have problems for me.
    What is the best word processor for the G3 running Panther (or Classic/9 for that matter). I need: Quick to load/run, readable text, automatic word wrap, spell checking and a reasonable path to exchange files with my desktop Linux system.

    AppleWorks does have a spellchecker; it just is not automatic (check-as-you-type).
    In AppleWorks, go to Edit menu > Writing Tools > Check Document Spelling.
    I've never used anything (in a major way) except AppleWorks.
    A couple of options which you haven't mentioned are Pages in _iWork '06_ (or earlier; the current version has left behind G3 processors) and _Microsoft Office for Mac_.
    I'm unsure of how well any of these will integrate with Linux. Open Office may be your best bet there. (I'm just guessing. It seems like common sense to me that Open Office would work with an open OS like Linux.)
    Another application which is creating a buzz and sounds like it could work for you is _Google Docs_. There would certainly be no problem with Linux integration there. It looks like it would be easy sharing all the way around and you shouldn't find any incompatibilities as long as you have a decently up-to-date browser.
    I'm not sure anyone has developed the "perfect" word processor, but there are some good ones out there. Good luck on your quest.

  • Chinese language word processor?

    I'm looking for a Chinese language word processor for OSX that will allow me to create mail messages, Word docs, etc. Any suggestions?

    I'm looking for a Chinese language word processor for
    OSX that will allow me to create mail messages, Word
    docs, etc. Any suggestions?
    If you just want a word processor that can create Chinese text, then just about any one will do. See this page:
    http://www.yale.edu/chinesemac/pages/apps.html
    If you must have the menus and dialogs of the word processor program in Chinese, the choice is probably more limited -- let us know if that is the case.
    As for email, Mail and almost all normal email programs can write and read Chinese, and the same is true of most web browsers if you use webmail:
    http://www.yale.edu/chinesemac/pages/internet.html

  • Product key not accepted - cannot register Word processor.​..

    Hi,
    I bought an HP dm4 including Windows 7. When I try to register the Word Processor program by using the Microsoft Windows 7 product key in the sticker at the bottom of my laptop I get a wrong key notice! 
    What is the problem?? 
    Thanks for help!! T. 
    Solved!
    Go to Solution.

    Please confirm the question I asked you. Did your computer come with Word 2010 Starter and Excel 2010 Starter already pre-installed on your laptop ? 
    These versions are versions that do not time out, they have a few features taken away from them that the full version has, if you want the full functionality, as well as access to power point etc you will need to purchase the full version. 
    *******DISCLAIMER********
    I am not an employee of BBY in any shape or form. All information presented in my replies or postings is my own opinion. It is up to you , the end user to determine the ultimate validity of any information presented on these forums.

  • Justification on word processor using java

    hello! i would like to ask if there is a function in java that has the function similar to that of the word procesor......or if anyone has created a function that does that.....please help thanks!!!!!

    Hi,
    in another of your posts I left a link to application SimplyHTML. The link is http://www.lightdev.com/template.php4?id=3
    Did you visit this link already? It leads to a Java application implementing a word processor. Does this meet your needs? If not, it would be interesting to hear about what you are missing in detail...
    Ulrich

  • Creating a DB2 � GUI

    Hi,
    I was hopping that someone with some DB2 experience might be able to give me a hand
    What I have right now is a script, using a bat. And .cmd file to do a DB2 export � import process. I have to download a DB that is on the mainframe to a laptop. What I want to do is create a GUI, so that the client can monitor the process (the black command window is not very appealing). I�ve noticed that the DB2 Control Center uses a Java GUI, so there is got to be a way to do it.
    So my question to you is:
    How do I create such a GUI? Is the �Runtime.getRuntime();� the right way to go? Or does an API already exist (can JDBC help me do this)?
    Can you give me some code examples or point me in the right direction?
    Thank you in advance.
    Johnny

    Hi,
    I was hopping that someone with some DB2 experience might be able to give me a hand
    What I have right now is a script, using a bat. And .cmd file to do a DB2 export � import process. I have to download a DB that is on the mainframe to a laptop. What I want to do is create a GUI, so that the client can monitor the process (the black command window is not very appealing). I�ve noticed that the DB2 Control Center uses a Java GUI, so there is got to be a way to do it.
    So my question to you is:
    How do I create such a GUI? Is the �Runtime.getRuntime();� the right way to go? Or does an API already exist (can JDBC help me do this)?
    Can you give me some code examples or point me in the right direction?
    Thank you in advance.
    Johnny

  • What word processor is right for me?

    Hi guys.
    I have done extensive searches on this topic, but still have some unanswered questions.
    First of all, my 1gig black macbook will be arriving some time next week (fingers crossed). I can't wait. As so many people with the intel chips, I now have to chose a proper word processor that will meet my needs. Needless to say, I can't wait until Office 2007 is released!
    Essentially I need to be able to receive word documents and powerpoint presentations from windows machines. I would like to be able to open them and edit them as I please. Also, I need to be able to send them back, open them on a windows machine and print them.
    I am a university student, so I only use word for papers that can occasionally include digital photos, or just pictures from the internet.
    I use powerpoint to look at lecture notes from my professor and need to able to take notes on them i.e. add my own info to the slides.
    I can live without Excel for now. I have seen the recent beta of NeoOffice, that looks like a very good solution. Can I send/receive documents to/from windows machines? My only problem with this solution is that it seems to require close to 400mb. That seems large to me and I would think the program might not be as snappy as I want it to be. Any thoughts?
    I could instal MS Office for macs, but since it doesn't run natively, I am hesitating. What about a program like Papyrus? I have downloaded a trial version and it runs extremely fast. I was not able to find a powerpoint equivalent on there. Is there one?
    Also, what about iWork? I saw that pages is is mainly for publishing and using fancy templates...Is that program more than I need? Keynote of course looks great.
    Any comments are much-appreciated.

    Appleworks has always worked for me since leaving microshaft! I use notta for MS stuff on my computer and in my home. I just went to the recent Pages and like it a lot - appleworks works on my MBP on intel and is quite fast but I am also going to switch over 100% to pages! I am actually in transition. neooffice loads very slow but it it nice. I tried and used to use it but i remember reading that there was support or development issues going on re: not happening or else the actual freeoffice ro whatever the parent app is does not support anythging with neooffice anymore so i stopped using it. I found some stsuff slow in neoooffcie due to it being run in Java.
    If it was to be developed and ssupported more I would probably try using it. be careful of the various builds re: your OS too. i was using a panther build before and that was my introduction.
    I am happy generally with pages. I need something that is as stable as I can get for business stuff.
    Neooffice is somethin if it does take off again that I would consider. but slow load and sosmetimes i type and there is a lag before the characters emerge on the page.

  • I have a MacBook Pro 15" 2007 which sometimes goes berserk writing the letter 'h', and makes a fast tapping sound when not in a doc. It stops when I hit the delete key. Also can't use the letter 'h' in a word processor.

    I have a MacBook Pro 15" 2007 which sometimes goes berserk writing the letter 'h' in a word processor. It stops when I hit the delete key for a while. Also can't use the letter 'h' in a word processor. The computer makes a fast tapping sound when not in a doc, in any application or in the finder or when a application is running. Sometimes when this is happening I cannot control the cursor. I have to hit the 'delete' key to proceed. Does anyone know anything of this?

    You are still under warranty.  Call Apple Care. Make sure you get a case number as all repairs have an additional 90 days of warranty. 
    #1 - You have 14 days from the date of purchase to return your computer with no questions asked.
    #2 - You have 90 days of FREE phone tech support.
    #3 - You have the standard one year Apple warranty.
    #4 - If you've purchased an AppleCare Protection Plan, your warranty last for 3 years.   You can obtain AppleCare anytime up to the first year of the purchase of your computer.
    Take FULL advantage of your warranty.  Posting on a message board should be done as a last resort and if you are out of warranty or Apple Care has expired.

  • Use an AudioInputStream to create a Processor - How?

    Hi,
    For my Application I need the javasound but I also need JMF.
    I was looking for an answer of the following question, but I don't find any:
    How can create a Processor out of an AudioInputStream?
    If anyone knows the answer, please tell me, because it's very urgend.
    thx

    Would I need to put the AEBS into bridge mode to prevent disruption of the network for the other guys...
    I did suggest that above. Even if you don't use bridge mode, it won't affect the others.
    ...or can it be set up as its own wireless network with a separate password?
    That is no problem at all. You can use the same SSID (network name) and wireless encryption type/level/password as the other network or you can create something completely separate. This will work regardless if you configure the AEBS to operate in bridge mode or not.

Maybe you are looking for