User Profile
Collapse
-
So, I'm still lost on how to traverse the cube correctly. i*j-k doesnt work right, it only works for the last square in the cube. The rest that shows up is one edge of the cube. -
the actual source code i have working that gives the triangle
that canged at different angles
Node n = new Node();
for(int i = 1; i<9; i++){
for(int j=1; j<9; j++){
for(int k=1; k<9;k++){
AtomSphere atom = atoms.get((i*j* k)-1);
atom.setLocalTr anslation(new Vector3f(i, j, k));
atom.setSolidCo lor(ColorRGBA.g ray);
n.attachChild(a tom);
}...Leave a comment:
-
oh shoot, i forgot to add that the add object is at i,j,k
Duh duh = duhs.get((i*j*k )-1);
duh.setLocalTra nslation(new Vector3f(i, j, k));Leave a comment:
-
JMonkeyEngine to create a cube
I'm using JMonkeyEngine, and trying to make objects in a cube. Meaning, a three-dimensional cube out of objects (Spheres, to be specific). However, the logic is escaping me. This is what I have so far:
for(int i = 1; i<9; i++){
for(int j=1; j<9; j++){
for(int k=1; k<9;k++){
add object
}
}
}
I'm really sitting here scratching my head, cause this gives a triangle viewed... -
Image manipulation problems.
I;m trying to scale an image (using the imgae's getScaledInstan ce method) before passing it to an ImageIcon, but it looks like the images are cropped. Has anyone had this problem before? Might it scale one side to the right side then crop the remainder on the other? -
Eclipse/Image error
On Eclipse, I've been getting this error that the method getScaledInstan ce is undefined for type String, but I'm not using Strings, rather 3 ints. Any idea on how to remove this error?
Image pic2 = pic.getScaledIn stance(640, 480, Image.SCALE_SMO OTH);
**EDIT** NVM, dumb mistake. -
i've since found out that this is only a problem on the machine I program on. Thanks anyway!Leave a comment:
-
Oh, same thing happens when I run as shortcut. When admin doesn't work, regular works but with FNF exceptions for writes only.Leave a comment:
-
FileNotFound, btw, is being thrown because of an access denied error. This is why I need to run as admin.Leave a comment:
-
Yes, it works when I run it from the command line as administrator. I'm using absolute paths. The directory exists, for now it's in the root of C. Might it be a problem with running the BAT file as an administrator?Leave a comment:
-
-
BAT errors
I created a JAR file with an application I'm trying to run. However, I'm using a BAT file to run the JAR, and when I do, the JAR is giving FileNotFound exceptions where it should be writing the files. I've tried running the BAT as administrator, but it just doesn't run. Any ideas? -
-
But my problem is, how do I change which value to check against? There's only one argument for compareTo, and I think I'd need another to show which value to check against. How would I do this part of the problem.Leave a comment:
-
Sorting dilemma
I need to sort objects (called items) in an ArrayList by a given field (name, price, etc). What is the easiest way to do this? I'm not sure how to write a comparator, if Collections.sor t is the easiest method. Then that becomes my question: how do I write a comparator that changes which field to compare depending on a value? -
GUI run problem
every time I run this code, the "remove" button only shows up if there's no picture there. is there any fix for this?
[code=java]
while(r<list.si ze()){
JPanel panel2 = new JPanel();
panel2.add(getS ingle(list, isSmall, r));
panel2.setName( ""+r);
panel2.setPrefe rredSize(new Dimension(200,6 00));
System.out.prin tln(panel2.getN ame());
panel2.setVisib le(true);... -
Ok, I went and loked up the getImageLoadSta tus constants and had them print out to the command line. One didnt load, the others (2 for now) did, but those two aren't showing up. Is there any other reason why this approach wouldn't be working?Leave a comment:
-
Ok, I tried that, but now I have another problem: the images don't display. Any ideas? What might I be doing wrong here?
public JPanel getImagePanel(S tring imageFile){
JPanel panel2 = new JPanel();
ImageIcon icon = new ImageIcon(image File);
panel2.add(new JLabel(icon));
return panel2;
}Leave a comment:
-
Image problem
I'm trying to draw an image to a panel, but am having problems with it not showing up. I know I'm creating/loading the image properly, but I have the feeling I'm not painting it right.
public class ImageGet extends JPanel{
public String file = null;
public ImageGet(String fileName){
super();
file = fileName;
setPreferredSiz e(new Dimension(300, 300));
}
public void paintComponent( Graphics... -
Whoops, forgot the source code to help with this.
public String main(ArrayListS erial list) {
x=0;
g=false;
JScrollBar scroll = new JScrollBar();
int r = 0;
JPanel uber = new JPanel();
uber.setLayout( new BorderLayout()) ;
x=0;
JPanel panel = new JPanel();
while(r<list.si ze()){
JPanel panel2 = new JPanel();
panel2.add(getS ingle(list.get( r)));...Leave a comment:
No activity results to display
Show More
Leave a comment: