I've made a few of simple Java applications last year [I am an engineering student and I have fallen in love with Java through a subject last term] - I learned a lot about classes, objects, listeners and various other stuff. The problem is that I had to use unusual libraries (I think they were optimalized to shorten some long parts of code and just to let us focus on the object-oriented fundamentals) - here is link: http://useobjects.net/ (never seen these anywhere else). Now I am trying to create a simple game in Java, (card game, say something like Solitaire) WITHOUT using these libraries - only with swing and another generally-known "core" Java libraries - and I am experiencing various (usually little) issues with mostly "everyday" simple tasks.
First problem - how to add an image from file into Java? Say, I have class Card, that can be shown or reverted, and I need to use 2 images (one for back and one for front); and I couldnt find any tutorial explaining the whole process with BufferedImage, View, Image,... and so on. (for comparison, in the libraries mentioned above, it was just something like this:
ImageView cardBack = new ImageView(positionX, positionY, height, width, filepath, angle etc.);
and the image was added and the task was completed.
Second problem is about main app window. In our old library, it was just something like this in main class:
MainWindow mainWindow = new MainWindow(title,height,width);
GroupView mainGroup = mainWindow.getRootGroup();
But when I tried to find out anything about creating a window, I found only JFrame-solution and I would like to ask you for a simple implementation example, and maybe how to solve classes at all (if should I create a "Main" class where will be JFrame just an element, or to make something like MainWindow class and create JFrame within this class, and create an instance of this class in Main, or ... simply, I am afraid, that my Java coding knowledge and XP is not fully compatible with conventions, so I ask for some recommendation in this way).
Thanks you very much.