This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Grokking Bitcoin and have Kalle Rosenbaum on-line!
See this thread for details.
Win a copy of Grokking Bitcoin this week in the Cloud/Virtualization forum!

Miljan Puletic

Ranch Hand
+ Follow
since May 19, 2016
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Miljan Puletic

Hey Paul,

Sorry for replying so late, lectures and all that...Yes, I did what you've proposed and I read little bit of documentation on JList's. Specifically, I used JListModel and it worked.

1 day ago
I have JFrame which is my central window, on it, I added simple JTabbedPane, it will have 4 tabs once I complete it. For now I'm having issues with second tab.

The goal of second tab is when I hit JButton "Requested" or "Scheduled" (action listener fires up), I should see a JScrollPane containing a JList object which contains certain number of (medical) Exam objects where each Exam has its string representation and that string is placed inside JLabel.  Now, the functionality which I require is to select any Exam and after selecting it to hit Cancel button which will cancel selected Exam (programming logic for actual process of canceling exam is completed, I just need GUI) .

I'm having big problems displaying that JScrollPane in JPanel and being able to select Exam.

Any suggestions?

P.S. sorry for some spelling mistakes...
1 week ago
Thank you Piet Souris, this helped, but I took some different approach using MigLayout.
1 week ago
1 week ago
Thank you sir. It is working.
1 week ago

Campbell Ritchie wrote:Spell it role (or rôle) not roll, and paid not payed.

Sorry for my english spelling

Campbell Ritchie wrote:Don't simply write Method. List the methods with symbols like +-%$, parameter and return types

I think it is not super important for UML to be completely accurate, as long as cardinalities and choice of classes is good.

Campbell Ritchie wrote:Your arrows look wrong.

I was just following Gliffy online uml tool which I uesd for the diagram. On lectures, we were shown Power Designer, and used it rule on cardinalities. Factory may have 0 or infinity products, but a Product must belong to only one Factory, so cardinalities are set on opposite sides.

Campbell Ritchie wrote:Why are you using Maps to record factories?

A friend suggested to have a HashMap because latter it will be easier to write date to db.

I changed it to HashSet. But i think it as well be a ArrayList?

If some one can answer on questions asked on the beginning it would be greate Thank you all for answers
1 week ago
Hi ranchers,

I got this assignment from a company. I am trying to get student internship.

So the assignment is bellow as well as my suggestion for UML. I would like for someone to analyse it, possibly to tell me other ideas, mistakes I made or some other useful tips.

Also I would like to point out that I do understand idea of patterns such as Strategy, Observer Patter and MVC (in the sense of as much as a second year student can understand after reading few chapters from Head First design patterns).

Project require Singleton Pattern, does that mean that only Company object need to be created in that way or maybe all of the object? Are there any recommended material so that beginners may learn how to apply Singleton in a given situation?

I'm not sure how to "enable communication" between Factroy, Shipment and Sales Place? Do I have to do that through some classes methods that will be inside UI package (that is view part of MVC)? What is the best way to keep references to other objects?

I would like to use Interfaces in this project, how to achieve that in the sense to use interfaces so I can get my design better and more flexible? Maybe to for interacting with writing to files and creating object from string (from a file)...I hope I passed what I want to achieve..

Make a simulation of production and sales network of electronic devices by respecting basic principles of object oriented programming. Aim of this assignment for the applicant is to show solid knowledge of object oriented programming and it is desirable to show usage of architectural and design patterns. It is not essential that application is working.

1. No date base should be used
2. No need to write html/css cod
3. Emphasis is on OOP
4. Try to implement following concepts in appropriate places:
-abstract classes
-singeleton pattern


Factories keep their records on production and distribution of products in sales places. During production, each product is assigned unique serial number. Sales places can submit requests for delivering required products to the headquarter, by stating products and their amount. There are more factories and sales places within company, where sales places are sending requests to the company headquarter, and each factory may deliver products to any sales place.

Create a simulation script which does the following:

1. Create a company
2. Create factory “El Facto 1” within company
3. Create sales place “Super Tronics” within company
4. Create an employee in factory, Mark Johnson, roll: production worker
5.  Create an employee in factory, Mary Peterson, roll: production supervisor. This employee is superior to Mark Johnson
6. Create an employee in factory, Tim Green, roll: transport supervisor
7. Create an employee in factory, Mike Trenton, roll: seller
8. Create 20 monitors in factory “El Facto 1”, under supervision of Mary Peterson
9. Send request from sales place “Super Tronics” for delivering 10 monitors and 50 keyboards
10. Transport 10 monitors and 30 keyboards from factory “El Facto 1” to sales place “Super Tronics”, under supervision of Tim Green
11. Create a buyer Michael Grey
12. Michael buys a monitor from “Super Tronics” for the price of 80eur, pays in cash, from the seller Mike Trenton

Add logging of actions in the system. Actions needs to be logged in a .txt file(s) in the following format [date and time] [action] [additional information]
Possible example of one line from log file:
[20.03.2016 11:30] Transport, products: 10 x keyboard, 15 x mouse, from: El Facto 1, to: Super Tronics, supervisor Tim Green

Actions which need to be logged:
1. Production of every product individually (serial number, tip of product, factory in which product was made, date and time, name of supervisor)
2. Delivery requests (sales place which submits the request, list of products with amounts)
3. Products transport (factory name, name of destination – that is sales place, list of products with amounts, supervisor name)
4. Each sale (list of serial numbers, sales place, name of the employee who made a sale, means of payment ( cash/credit card), name of the buyer (if it is payed by credit card)

Thanks you ranchers

1 week ago
Why there is no gif when I place mouse over a doctor?

3 weeks ago

Please explore those two \bin folders in Program Files and verify that they contain java.exe, javac.exe, etc. Please verify that you have spelt their names exactly right. I can't see any spelling errors.

There's only one /bin folder inside jdk folder. Tried what you proposed, still error shows up. Bin folder does contain javac.exe as you can see.

What the heck is going on here??
3 months ago
Thank you gentlemen for replying so fast.

I did't get any error messages during download or installation of jdk. Wizard just said "you have successfully installed JDK.."

The path that I passed here is the entire thing that is in Path variable. I make sure to copy the entire box.

I tried to replace word "Data" with "Files" but that wasn't working as well. Again I get same message in cmd.

3 months ago
Hi, I am trying to install jdk11 but somehow I can't install it. I read few topics here but I cannot figure out the reason why javac is not recognized...

java jdk-11.0.2 install folder is in C:\Program Files\Java

Path variable is set to the following: C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\jdk-11.0.2\bin

When I type java or javac I get: " javac' is not recognized as an internal or external command,
operable program or batch file."

What am I missing so I can install the bloody thing on the machine?
3 months ago
I have completed Stanford`s Java Programming methodology. I did it in 4-5 months with relatively high level of thoroughness. I did 6 out of 7 big assignments, did all homeworks, read couple of times course reader The Art and Science of Java by Eric Roberts etc. Since the title is almost self-explanatory, how do I proceed further ?  

I decide not to go for CS106B (C++ course), but rather to continue developing Java skills.

Somehow I think that tutorials are not giving you much of practice versus books. So my thoughts are to start with some good book, where there are good programming assignments, small and big ones, easier and more difficult...After reading this, somehow it seems that HeadFirst is my natural choice. Although, after I looked at several chapters of the book, it seems that it does not have enough assignments and concrete tasks. But on the other hand, that book gives very nice theory and I prefer that style of writing.

What would you guys do, all suggestions are more then welcome.
2 years ago
Thnaks, I got it now.
2 years ago
I have no idea why I am I getting prompt "ArrayIndexOutOfBounds" ?? Maybe is something benign, but I just dont see it. The console prompt is also telling my to look at line number 16, but again I think that my logic is ok. Can someone tell me where is the problem ?

2 years ago
This is not a code-related question but rather what to do next.

I`ve been studying Java from Stanfords lectures channel and studying from the book The Art and Science of Java by Eric Roberts. I have been studying it thoroughly for well almost five months (I know it`s super small amount of time...) beside that I have been doing homeworks and all other necessary assignments (for instance we have made the Breakout game) with complete understanding of what had been asked. I did my best and I`ve learned a lot! Now I understand the concepts, but I am not sure in myself in the sense whether I am good enough to start implementing that learned knowledge into something useful such as building mobile apps. My goal is to learn Java just enough so that some company would take me as an (unpaid) intern. How to scale my knowledge ? What should I learn next ? How to determine how far I am from junior position ?  

2 years ago