Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

And if you look through the Read Me: Getting Started thread stickied at the top of the forum you will find more help info and links on this.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Though most of it probably won't get parsed and there is no telling how it will display. The HTMLEditorKit which does the rendering for Swing components is pretty simplistic and limited in it's capabilities.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

That exception occurs when you try to call a method on an object variable that is null. Look at the error message and it will tell you which call caused the error. Then you must figure out why that variable is null at the point you are trying to use it.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Actually you post your question here: http://www.daniweb.com/forums/forum114.html in the Python forum.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Use Integer.parseInt(java.lang.String,int) with a radix of 16 if you need to convert the hex string back to an int.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

please give a reply.i need the software

What software? What are you talking about?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can't access jars within jars.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, in the manifest you just separate them with a space. No other delimiter needed.

Class-Path: Some.jar Another.jar
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can have as many jar files as you want in your application's classpath. Add it just like you did for the mysql connector.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No idea. Have you read the documentation on setting it up? Do you have Subversion installed, since it seems to be an SVN based installer?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

There is no such thing as a "simple speech recognition application". It involves complex signal processing and analyzing algorithms. If you find a library for speech recognition, it will have it's own API and documentation for usage, which you will have to learn for yourself. This is not information that you will find on a general Java forum.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

What is your question about it? Surely you don't expect us to just fix the code for you based on how we think it should work?

Post specific questions or errors that you are receiving.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You would be better served checking the "nbusers" mailing list archives or posting a message to it: http://www.nabble.com/Netbeans---Users-f2605.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Use String input = in.nextLine(); instead of in.next().

Also realize that you are not reading anything from a file, you are appending the filename they entered to your StringBuilder. You have to open that file and read it's contents into your StringBuilder.

s.o.s. makes a good point about managing how much you are accumulating into that StringBuilder in memory before you write it out to your output file. You haven't stated the details of the assignment, but you may want to review the specifics on file size assumptions and io buffering. Those are things that you would have to manage if this were a real application.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Any tutorial on network socket communications will demonstrate this. Here is the Sun tutorial on it: http://java.sun.com/docs/books/tutorial/networking/index.html

Many more can be found with a simple internet search.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can declare an initial capacity if you wish, but if you do not then it will manage that itself by expanding the backing arrays as needed.

You just need to add to the StringBuilder with append(String) that you read from your input files.

Pass StringBuilder.toString() to the PrintWriter as needed to write the string.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

A StringBuilder can be used to collect the text from each input file.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The "starter code" is doing two separate things which seem to be at odds from one another:

import java.io.IOException;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * This program concatenates contents of several files into one file.
 */

public class CatFiles
{
   public static void main(String[] args) throws IOException
   {
       [B]// this section is just reading input files until "q" is entered
      // and then prompting for the output file[/B]
       Scanner in = new Scanner(System.in);
      
       int j = 0;
       boolean done = false;
       while(!done)
       {
           
           System.out.print("Enter input file: ");
           
           if(in.nextLine().toLowerCase().equals("q"))
           {
               System.out.print("Enter Destination file: ");
               String output = in.next();
               PrintWriter writer = new PrintWriter(output);
               done = true;
               [B]// your code here to write the collected input to output[/B]
           }
           else
           {
               String input = in.next();
               [B]// your code to go here to read this file into your collected input[/B]
           }
       }   
       
      [B]// This section is collecting the input and output files
      // from the arguments supplied when the file is run
      // it doesn't really have anything to do with the console
      // stuff above[/B]
      if (args.length < 2)
      {
         System.out.println(
               "Usage: CatFiles sourcefile1 sourcefile2 . . . targetfile");
         return;
      }

      String target = args[args.length - 1] ;
      


      for (int i = 0; i < args.length - 1; i++)
      {
         String source = args[i];
     
      }

 

   }
   
}
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

AbstractTableModel.isCellEditable(int,int) returns false by default, so you don't need to override it to get that behavior.

The DefaultTableModel implementation of that method returns true by default, so that one must be overriden if you wish to make cells un-editable.

(And the post you are responding to is over 3 years old...)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Look over his shoulder.

Ancient Dragon commented: great idea, and useful too. +34
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Needs more commas.

Ancient Dragon commented: HaHa :) +31
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Correct. You aren't processing all of the text within the line, you are merely looking at one location and then moving on to the next line.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You really must be at your wits end.. because you posted this in the Java programming forum instead of the Javascript forum which is clear over here: http://www.daniweb.com/forums/forum117.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can use Java WebStart or write your own updater that connects to a server and downloads new files as needed.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Horizontal wheel scrolling currently it isn't supported, though it's in a request for enhancement: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6315717

You would need to write JNI code for it for the time being.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No one is going to give you a completed project. It's pathetic that you would even ask this. You need to complete your coursework on your own.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Use search. There are a thousand posts here about the exact same thing.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

And this

int point = (4 & 5 & 6 & 8 & 9 & 10);

equals zero - so comparing that against roll with == isn't going to do whatever it is that you think it will.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

String.matches("[a-zA-Z]*");
Will return true for a blank field or a string consisting of nothing but letters. You can tailor that pattern to allow spaces, certain punctuation, fail a blank entry, etc. to suit your needs.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

looking back at the code i remember why i used the Object for the loop, in the constructor for the class i pass the ArrayList and could not use the Generics for passing it, if you know a way it would be appreciated the only thing it holds it OLine's

The code that creates the list List<OLine> lines = new ArrayList<OLine>(); and the constructor public SomeThing(List<OLine> lines){

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Keep in mind that you won't get any sixes with that code for the random numbers. You'll get 0-5. You need to add one if you wish to work with 1-6 as your range.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

From the link that stephen84s posted in your other thread - the one to JFreeChart. Did you download it or just some example code?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

There is a full tutorial on creating a 2D "Space Invaders" game in Java here: http://www.cokeandcode.com/node/6

There is also a 3D "Asteroids" tutorial on the same site.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

thxs all and i said i need some help here
since i know the loops and String and Array and many many thing

Start writing it then and post your code and questions when you have difficulties. We are not here to walk you through the entire thing.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You use File and the various input streams, just like any other file you would access. The CD rom is just another drive, you know.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

change ur for loop like this and add new Frame() in ur JOptionPane

for (int i = 0; i < count; i++)
{
System.out.print(studentScores[i] + " ");

// Declare and initialize output

JOptionPane.showMessageDialog(new Frame(), "Student Name: " + studentName +
"\nScores: " + studentScores[i] + " " +
"\nAverage: " + average +
"\nHigh Score: " + studentHighScore +
"\nLetter Grade: " + studentLetter);
}

sciwizeh is correct, null is the appropriate argument there. Passing "new Frame()" is absolutely useless.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, posting the error might help. We can't read your screen from here you know.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Actually, I just saw that the links I posted were to my local copy of the API docs, but anyway, the child classes of Number all have functions for converting between other representations and working with the numbers as bits.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Sounds like a reasonable assumption. So now step through the code and determine why that scanner has not been initialized when you need to call it.

Consider that your read() method doesn't actually process anything. It just set's the scanner reference. You only call getWordCount() etc after read() has thrown an exception. Perhaps you should let getWordCount() and the other getX methods just return the current count values from the class and move the code that counts those things into countWords(), countX() methods and call those methods within read().

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

A couple of System.out.println() statements at a few key points could probably illuminate exactly what it is trying to copy where in short order. If you are using an IDE with a debugger, stepping though would be even faster.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, those NullPointerExceptions tell you the variable that was null and the line it occurs on. Have you looked at those locations and tried to figure out why the variable is null when you use it?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Does that make any sense ?

Nope.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Take a look at some of the methods on the Long and BigInteger classes.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Though a few versions out of date, this free online book has a lot of thorough explanations of these things and is still very relevant to most of the basics: http://www.codeguru.com/java/tij/

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Right-click is easy to handle

jButton1.addMouseListener(new MouseAdapter(){
    public void mouseClicked(MouseEvent e){
        JOptionPane.showMessageDialog(null,"Right-click stuff");
    }
});

Changing the button select color is easy if you are wanting to change it for all buttons in your program - even the ones that appear on dialogs and such. For that you can set "Button.select" property in the UIManager properties

UIManager.put("Button.select", Color.BLUE);

If you want only specific buttons to have the different selected color, you'll have to install your own button UI delegate that extends BasicButtonUI and override the

protected void paintButtonPressed(Graphics g, AbstractButton b)

method and perhaps delegate all other operations to the current look and feel ButtonUI, which may get tricky if you aren't used to pluggable look and feel UI delegation model. There is a complete custom ButtonUI implementation here: http://www17.homepage.villanova.edu/william.pohlhaus/is/doc/Java%20Look%20and%20Feel.htm#_Toc49238503 if you want to wade through it.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Who knows? Never heard of "ArrayInitializer". Though that code does not compile due to a missing semi-colon, and it does not produce a correct result if corrected to compile.

jasimp commented: stephen84s knows +7
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The scanner that you are initializing in the read() method is not the same one the rest of the class is using. You have declared a new Scanner with the same name that is local just to that method

public void read(Scanner console) throws FileNotFoundException
   {
       String input = console.next();
       FileReader reader = new FileReader(input);
       [B]// This is not the same as your class-level "in" variable[/B]
       [B]Scanner in = new Scanner(reader);[/B]

   }
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Please be aware that Javascript has it's own forum. This is the Java programming language forum.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I don't follow what you mean. If the class extends Applet or JApplet, it runs in the Applet viewer when you run or debug the file.

Alex Edwards commented: Hah! I figured it out. I kept trying to create an Applit from a new Project, and not an existing package! I'm such a nub! +1