File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Combining two classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Combining two classes " Watch "Combining two classes " New topic
Author

Combining two classes

Jason Newman
Ranch Hand

Joined: Oct 20, 2010
Posts: 53
I have two classes(?) that I am trying to combine into one. I am basically trying to pull sentences from an array randomly, and place them into the JOptionPane. I have been trying to do this for a few hours, and it's late and I'd like to finish soon. Here is the code, if this helps answer my question.

Sentence gen part:


And the Other part:


OptionPane.showMessageDialog(SetenceGenerator.JOptionPane.PLAIN_MESSAGE ); //see here I tried to incorporate the sentence gen, hoping that having it in the main method along with this part of the code it would work. It did not.

Please, any help that you can contribute would be amazing!
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19538
    
  16

Please UseAMeaningfulSubjectLine. Do you really think "Help?" is going to attract any viewers? You can edit your post to change it.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Jason Newman
Ranch Hand

Joined: Oct 20, 2010
Posts: 53
Better?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19538
    
  16

Yep.

As for the issue, you will need to create an instance of SentenceGenerator, then call generateRandomSentence(), then show that inside the JOptionPane.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Combining two classes
 
Similar Threads
Deadlock testing class for B&S 2.2.1
Tests for the Data class/locking mechanism
Generating Unique Random Numbers in JAVA
DHPublicKey not for this KeyAgreement!