How to you make sure that a variable passed to a method isn't altered by the method? I know in C++ you can do something like
void aMethod(const Object &item)
{
........
}
Type: Posts; User: GoodbyeWorld
How to you make sure that a variable passed to a method isn't altered by the method? I know in C++ you can do something like
void aMethod(const Object &item)
{
........
}
JTextPane has a method to add components and icons and stuff and allows styles to create tables. It also has a print method. However, when it prints it
1.) Removes the tables and non-text stuff...
I have looked on Google and can't find a solution to the issue. I think I may have found one solution to it that somebody posted, but, alas, the link is dead. :(
I cannot find a solution online...
I see that you are passing userB to the function but you never use userB.
I'm assuming that the type that you would need, as he said above, is BigInteger.
Main.java
import java.io.File;
import java.io.IOException;
import java.io.FileNotFoundException;
public class Main
{
As I couldn't find a way to do the printing of multiple items on one page, I decided to test out my idea. I found that I could have a table in a JTextPane.
However, whenever I got to print, my...
Still no reply from him. Maybe someone here can help. I can tell him I got help. I'm not understanding how he wants me to do it without using PrinterJob (which does it on separate pages).
I'm...
He still hasn't replied yet. It's got to be something really simple yet I can't figure it out. I have looked and looked. There seems to be no way to get the Graphics object.
It is driving me...
Ok, I heard that java doesn't really have any easy way to get it to say, call print on a JTable and a JTextArea and, even if there IS room, to put them on the same page. It always seems to go to a...
I checked the source code of the JRadioButton, JToggleButton, and AbstractButton classes. There doesn't seem to be anything in the paint methods that deal with reshaping the border to be...
I tried to make a custom swing component. I managed to get it to draw it right. However, there is a problem. It still has a rectangle border. I want it to have the border of the shape passed to...
http://www.javaprogrammingforums.com/java-theory-questions/35826-java-urgent-help.html#post139476
http://www.javaprogrammingforums.com/whats-wrong-my-code/35827-urgent-please-help-form-code.html#post139473
I was asking, as it seems that they don't cover .wma or even .mp3 files in the JavaSE Sound APIs, is there a third party package that can do it?
If so, do you have any idea what that third party...
Not sure what you mean on the first one. You can either do a picture that can be clicked as a JButton that has an icon as its content or you can have a JLabel that has an icon as a content and that...
I was looking at the Sound API pages in the java tutorials. I was planning to use it to run wma files.
Fortunately, for me, I found, soon into the tutorials, that these API DON'T support the type...
So, the "\n" is cross platform already.
Also, when you say "writing to disk", do you mean the hard drive, and hence that I shouldn't use JTextArea write() or whatever it was called to do it?
...
Thanks. So, what do you use then for a cross-platform line break thing? I heard that "\n" was only for Windows or something. That it wouldn't work on all systems.
(By the way, I did get it...
I have made a SSCCE, it only has what I need. The problem happens to be replicated in this section, so my hunch was correct of where the problem was coming from. I think I might know the issue.
...
So, you got it to draw the food then? That was the issue in your other thread.
Anyway, all your head would need to care about was the one after it. The same thing for the one after the head. ...
I don't know what a SSCCE is. I thought it was a program that was a short as could be made that included the problem, and, if possible, compiled.
This one doesn't have a main method, true. I...
I don't quite get why it needs to have Object arrays as elements. However, it does have all of the items it should, it's just not displaying them.
It appears to be in the method...
public class TestClass
{
public static void main(String[] args)
{
PizzaMenu pm = new PizzaMenu();
// call methods and stuff with pm object
I have no idea quite what it's doing in the ComboBoxModel section part with all the arrays of Object. I have tried what I thought should and have tried removing all the elements, hoping that would...
I think I can do most of that stuff. (The weird thing on the JScrollBar will be a bit trickier but I've done something like that too where I had the scroll bar be a snake icon instead and could use...