masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yeah, well, I see where you create a JFRame, a JPanel, and a JTable, but no where do I see where you add the JTable to the JPanel, or the JPanel to the JFrame, or the JTable, to the JFrame, etc, etc, etc, so, yeah, you see a blank JFrame. (Except for the one line where you add the table to the panel, but that is commented out, and you don't do anything with the panel after that, anyway, which makes it useless anyhow.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Because you are only asking the user for a single value. And then "counting" and adding those counts to the lists. You, obviously, need to ask the user for the values.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I thought you wanted lists of Integers? Where did you copy this from (not that it's very good, BTW). Simply use the "addAll" method from the Collections class, see the API docs. And, of course, put the code into it's own method (as the description says). Retuning a reference, is, obviously, returning the "new" list. Retreiving input from users is something else, entirely, and you already have another thread on that.

Now, at least try to do your homework.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Make an attempt, at least. If it "doesn't work" then post that code and describe, exactly, what "doesn't work" mean and provide all (and complete) compiler/error messages.

This is not a code service.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What makes you think you can? You can't.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That is why I told you to ask specifically about "mime types" and "file associations". You don't have to even get into what language you used to write the application. That is irrelevant. You simply want to now about an OS specific feature, so ask about that feature on a forum for the OS involved.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Ask about mime types and file associations at an MS forum.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

index 0, index 26, index 1, index 27, index 2, index 28, etc, etc, etc,. Do you notice a pattern there? I.E. "+ 26"? Write a loop and use index and index + 26.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Using "swap" makes the card trade places with the one your swapping with, which, obviously, does not make the former second card the third card, which you also need to do, of course. Swap is not what you want to use. The easiest way is to create a new vector and simply add the elements to that in the order in which they should be added, then replace the original list with this new one.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, nested loops for the first and second half you don't want. You want a single loop. You also don't want swap as that is moving the first card to the middle and the middle card to the front, when what you really want is to leave the first card at the front and insert the middle card into the second position, etc, etc, right? You need to rethink your algorithm.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

See the "Collections" "shuffle" method, maybe?

But, line 20 is your real problem. There you declare and define "deck" as a local variable. Didn't you really mean to define the instance variable? If so, leave of the first use of "Vector" on that line.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What do you "get now"? And the error message still shows you exactly where, so where?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

An NPE provides a Line number in the exception messgae, what is it?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And did you check the port? Oracle normally listens on 1521 (or is it 1541? something like that, anyway) look at your oracle configuration. You seem to be attempting to connect to a web server. That won't work, of course.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

In what way is that? Post that code explain, exactly, what "didn't work" means.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

:sigh:

And have you read that article, yet?

P.S. that reasoning, as well as that command, will work just oh so well on unix platforms, as well, huh?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If they are both on the same machine, or have access to a reliable shared disk (although the processes that create and maintain that shared disk also use sockets, so I guess that one doesn't count) yes. Is it practical? No. Is it effecient? No. Does it make any kind of sense, what-so-ever? No.

How are they to communicate? Telepathically?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

8080 almost definately not, and you should, of course, be using "jdbc:oracle:thin", not "jdbc:odbc:thin", of course.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And for general information read this article thoroughly. You are falling into the "not a command" trap.

But Peter is correct, you should not be using Runtime for this, at all.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

croos-post Seemingly, he wasn't happy with the answer on that forum, so he posted the question again, here, without manners enough to mention that he had already gotten an answer, thereby purposely wasting other's time.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That is an OS specific question. No programming language has anything to do with the file and user rights system of the OS on which it is running.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

:sigh:

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Yes, study what the code is suppossed to do and then program it in Java. Simply "converting" it would only create a hack that would be far from effecient.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If not is there another way to do this?

Yes, have the method return that "new" array.

Java is pass-by-value and pass-by-value only. If you want pass-by-reference, use another language. If you want to use Java, then you need to abide by pass-by-value.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

for the "beginning" of the scrollbar

scrollPaneVar.getHorizontalScrollBar().getValue();
scrollPaneVar.getVerticaalScrollBar().getValue();

Add these values to the above values to get the "end" of the scrollbar

scrollPaneVar.getHorizontalScrollBar().getModel().getExtent();
scrollPaneVar.getVerticaalScrollBar().getModel().getExtent();

Divide those summed values by 2 to get the "middle" of the scrollbar.

See the API docs for JScrollPane, JScrollBar, and BoundedRangeModel.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That doesn't change the fact that you are going about it all wrong. I would like to know how you got anything to work at all without the "full" jdk.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

It may seem helpful to a beginner, but it's not. IDE's are for people who already know what they're doing in order to increase their effeciency. You need to understand the tools and the processes behind everything and an IDE shields that from you.

stephen84s commented: Eggjactly +5
tux4life commented: Totally agree. +13
masijade 1,351 Industrious Poster Team Colleague Featured Poster

That semi-colon ( ; ) at the end of your for statement ends the for loop.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Neither of which are options in Java. Those would be OS specific options and you would have to write a JNI library per OS to be able to do something like that, so, if you are going to pursue this course of action, start asking at an OS specific forum how that goal might be accomplished (without any regrad, what-so-ever, to Java) then delevop a native library for that, then use JNI to use that library.

Edit: P.S. you do know that option 2 is no option at all, right? Hidden, is just that "hidden". It's like hiding a chair behind a wall. You can't see it anymore, but, as long as you know it's there, or you know how to search for it, you can still get to it. The only way to "completely" hide something, would require "hiding" it from the OS itself, which means not using the filesystem at all, which means writing bytes directly over the hardware decvice, which would be a dangerous game, as the OS could overwrite it at any time, and your "writing" could mess up the OS, as well.

And locking so that "even Admin" can't get at it is also not possible. Admin has rights to everything on the file system, and for good reason.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, maybe if you had provided us with the actual error messages, we might have been able to solve it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Take a look at this.

class A {
  private JPanel p = new JPanel();
  public JPanel getP() {
    return p;
  }
}

class B {
  A a = new A();

  public void doit() {
    a.getP().add(new JLabel("A"));
  }
}

That's the way you do it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, where are you actually displaying PhotoPanel? I see you crating one, but you are not adding that Panel to anything. Part of "displayGui" in that Psuedo code above also inlvolves creating PhotoPanel and adding it to a JFrame of some sort. Then later you simply use setImage(image) and validate/repaint on the already displayed PhotoPanel object. You do not create a new PhotoPanel everytime you change the image, especially when you don't even do anything with that PhotoPanel. It doesn't just magically pop up onto the screen somewhere, you know?

Edit: Also, as already said, do not override paint, even if all it is doing is calling super.paint.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, setImage needs to actually assign the image given to an instance variable, of course. Otherwise, bi, essentially, doesn't exist anymore once the setImage method is finished, of course.

And don't override paint, and definately do call this setImage from within paint or paintComponent.

Here, in pseudo code

class PhotoPanel extends JPanel {
  BufImage bi;

  void setImage(BufImage localBi) {
    // do whatever with localBi
    bi = localBi
  }

  void paintComponent(Graphics g) {
    super.paintComponent(g);
    G2D g2d = (G2D) g;
    g2d.drawImage(...)
  }
}

class main {
  void main() {
    photopanel p = new photopanel();
    displayGui
    askForImageURL
    BufImage bi = loadImageFromURL
    p.setImage(bi);
    p.validate();
    p.repaint();
  }
}

That's all there is to it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Drop lines 27 & 28. That is exactly what I told you not to do.

Also, the setImage method should take an image as an argument, not open any GUI and ask for one. IOW, you should ask for and load the image elsewhere and pass the loaded image to the PhotoPanel.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And, are you able to "connect" to the device? If you can't do that there is no need to go any further. Then, once you can, simply open the stream, read a fair amount of the bytes (simply use the read(array) method) and write those to disk somewhere, than start to study the data (probably with a hex editor first). Once you know what is sent on the signal, and how it is sent, you can start to manipulate it. All of that (except for the specific read method mentioned) is also language independent. You might try Google to see if anyone else has already done some part (or all of the above) already and posted their findings. That way you can cut out some of your own time. Otherwise, you are in for some long nights.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What do the API docs say about it?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Add a single JPanel to the JScrollPane. Use FlowLayout with vertical (or horizontal, depending on which way you want to "scroll") alignment in that JPanel, and add the JPanels that are to be added "dynamically" to that JPanel. Then, don't forget to call validate() and/or repaint() on the JScrollPane.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Nothing to do with Java, to tell you the truth. The signal that the Wii uses, and what (and how, i.e. in what form) data is transmitted/received over that signal is what's at issue, and that is completely language independent.

Try to find the signal, then read the bytes from it, and study those. If it's bluetooth, its bluetooth, so get yourself a bluetooth adapter for your pc, and see if you can "hack" into the signal.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That is not a portability issue. You do not simply grab a components graphics and paint to it, as that "painting" will be "removed" the next time the component refreshes. You need to rewrite this "PhotoPanel" class and give it a "setImage(image)" method and then, in that class, override paintComponent to draw the Image. Then you call setImage(image) followed by validate() and/or repaint().

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You should not be calling "paintComponent" directly. You should be calling validate() and/or repaint() on the component.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Make it recursive.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You are never actually getting the file sizes.

Where in that code do you do file_size += whatever ?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

replace all single slants with double slants before (or while) calling "aregex".

str.replace("\\", "\\\\")

note: replace, not replaceFirst or replaceAll.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You can't.

I am not going to take forever to describe this so think about it a bit. Rather than applying the "toLowerCase" and "nextToken" immediately, set a boolean variable to true, then, on the next iteration, when that variable is true, do the "toLowerCase" and set the variable to false.

But, it's not as though you're doing much with the stuff, so I see no reason why you can't simply perform the actions you're performing then and there.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

this

st.nextToken().toLowerCase();

produces a new String object. what are you doing with it? It also, of course, consumes the next token in the String.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A String is immutable. You can "change" the String, but that really creates a new String. It is impossible to change a Strings value, so you need to read the Tokens and save them into a new String.

tokenizer = new tokenizer(line);
StringBuilder newLine = new StringBuilder();
while(hasmore) {
  if (matches) {
    newLine.append(token.toLowerCase);
  } else {
    newLine.append(token);
  }
}
line = newLine.toString();

Edit: Again as quasi pseudocode.

masijade 1,351 Industrious Poster Team Colleague Featured Poster
if (token.matches(regex)) {
  nextToken.toLowerCase()
}

as pseudo code.

try it. If it doesn't work post your attempt and we will help you correct it.

Once again, see the API docs for String.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

As long as you're not doing any Runtime.exec type stuff you shouldn't have any problems. You will want to test it, first, though.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

matches and toLowerCase ?

See the API docs for String