"Write an application that displays a frame containing two panels. Each panel should contain two images (use four unique images - your choice). Fix the size of the first panel so that both of its images remain side by side. Allow the other panel to change size as needed. Experiment with the size of the window to see the images change orientation. Make sure you understand why the application behaves as it does."
This is what I have, but the book doesn't say how to tell a panel to change its size or allow its labels to rearrange as needed, it only showed that will happen to the primary panel and its components in a frame. Apologies for being a noob.
import java.awt.*;
import javax.swing.*;
public class Faces
{
public static void main (String[] args)
{
JFrame frame = new JFrame ("Sum Faces!!");
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
ImageIcon face1 = new ImageIcon ("face1.jpg");
ImageIcon face2 = new ImageIcon ("face2.jpg");
ImageIcon face3 = new ImageIcon ("face3.jpg");
ImageIcon face4 = new ImageIcon ("face4.jpg");
JLabel label1 = new JLabel (face1);
JLabel label2 = new JLabel (face2);
JLabel label3 = new JLabel (face3);
JLabel label4 = new JLabel (face4);
JPanel subpanel1 = new JPanel();
subpanel1.setBackground (Color.white);
subpanel1.setPreferredSize (new Dimension(650, 220));
subpanel1.add (label1);
subpanel1.add (label2);
HMMM WHATS THE POINT OF HOMEWORK? OH YEA!!! TO DO IT AND FUCKING LEARN SOMETHING!!! EARN YOUR OWN GRADES FUCKTARD
Name:
Anonymous2007-01-24 4:10
>>6
You are missing one thing, this guy is going to become a Java programmers, for Java programmers there is no requirement of actually knowing the language.
>>6
This is a way of learning. And finishing the homework. It is also painfully obvious that you are unable to help him. Fucktard.
Name:
Anonymous2007-01-24 9:42
We never did something interesting like this in my java class ;)
it was all console junk and a few applets that were only able to run if you used the IDE :P
Check Sun's documentation. They have some pretty in-depth lists of the methods you can use with each object.
Name:
Anonymous2007-01-24 10:23
>>7
I've seen these people work, for real. All they do is Google snippets and copypasta them over and over. They have to do something that deals with running an external command? They Google it. Connecting to a web service? They Google it. Then they see how they can adapt the code (if at all) and copypasta it. (They usually copypasta first, fail, then adpat.)
>>9
I would know, but I want to forget... Writing Java was the least fun stuff I had to do at work at one point. Java sucks as a language and as an API. Just Google for Sun Java stuff and you'll see what Java is about: optimizing cash flows to creaete synergies between your enterprise departments that increase your profits and reduce TCO.
You know something sucks when it has anything to do with businessmen and managerspeak.
Name:
Anonymous2007-01-24 15:46
Well screw it then, it's a really really really small part of my grade. And I don't really want to learn Java, I just need a programming course.
Name:
Anonymous2007-01-24 16:04
>>9 No-one here actually knows how to solve your problem
It's not that I don't know, it's just that I don't give a flying fuck about it. I could write it in a thousand languages, but not Java, it sucks you know? I could write this using Qt, it would be prettier, easier, faster to write and execute, extensible and more cross-platform than a thousand Java virtual machines. I deride Java because it sucks.
Wrong. I am very well able to assist, but why give out freebies? I earned my own grades through something called personal effort. bite me.
Name:
Anonymous2007-01-25 0:15
Why reinvent the wheel?
Name:
Anonymous2007-01-25 15:39
>>15
I've used Qt 10 times more than Java for a reason: it is useful and usable. But it was just an example, I could tell you about STL, Boost or QuantLib but you're too stupid to know about these libraries that kick the crap out of Java.
The bus itself followed by the loud booming cry of HAVE YOU READ Your SICP today which felt as if it was totally fucking obvious Trolling is a very profound experience It can be accessed using the command line behaved the same way others do In a few weeks Nothing wrong with Haskell and Parsec!
Name:
Anonymous2009-03-06 12:53
Programmers is there any good tutorial for using EVP functions and blowfish symmtetrical.
Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy