omar tawfeek

Ranch Hand
+ Follow
since Apr 17, 2018
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by omar tawfeek

Paul Clapham wrote:Actually... instead of having somebody try to explain networking to you in bits and pieces, you could try reading a book instead. Here's a good one for beginners: Networking For Dummies.

You may find tutorials online if you care to search but the field of networking is large enough that a book is a better source.



yes im not working at a programming company , i am working atm at a small company as a designer but i want my carrier to be a programmer so i am trying to make a small application and setup it for them so i can work in a programming company .

i am really thankful for you paul for this book i am sure that it will serve the needs of mine , thank you again ♥

Paul Clapham wrote:

omar tawfeek wrote:thats great but how can i upload my application and its database on a server is there any tutorial out there teaching me how ?



You aren't going to do that. The server is a computer so you are just going to sign on to that computer (as an administrator, hopefully) and install the database.

And if you're going to write a desktop application, then there's not much point in having it on the server. It needs to be on the computers which belong to the people who are going to use it.

Again, none of this has anything to do with Java. It's just basic computer network management.




can you tell me where i can find this or how i can install 1 computer for network ?

i am so sorry i dont know how to do this :(

Paul Clapham wrote:The terminology is confusing you. A "server" can (and often does) mean a computer on which you run various applications whose purpose is to serve other applications. And it can (and often does) mean one of those applications.

For example a "web server" can be an application which responds to HTTP requests by sending back web pages as its response.

None of this has anything to do with Java, really, except that you could write a server application in Java if you liked.

As for desktop applications written in Java, you could use Swing or JavaFX. However it doesn't seem like there's a lot of people using those features to write client software nowadays. It's much more common to use something like REST-ful web services to connect to the server. Of course you could use Swing or JavaFX to use those web services but what I mean is, it's more common to use JavaScript in a browser to do that.

And as for ".exe", yeah, you could do that in Java with some extra work but it's unnecessary and just provides another source of problems for you to stumble over.



thats great but how can i upload my application and its database on a server is there any tutorial out there teaching me how ?

also does it work on desktop application and web application ?

Paul Clapham wrote:Your database is going to require a server, there's no getting around that. But there's no reason to be concerned, either. You can (and should) set it up so that it's only accessible within your local network -- this is the standard way to set up a database.

If you plan to write a desktop application for a sales system, well, that's sort of an unusual thing to do now. Desktop applications are very out of fashion. But they are still possible.

As for do you need Oracle SQL, no you don't. There are lots of SQL databases available, Oracle is just one of the possibilities.



can you recommend me desktop application alternatives ? i want to make a small program .exe and make a lan network server without internet .

can you recommend me a server that i can upload database into or the server should be on a server pc ?

sorry i am new to java and i want to learn more :)
Im going to work on a new application for a sales system with java and SQL ( desktop application )

but my question here is it possible to make database without a server that it only work within a specific internet connection without internet ? what i mean that it only works with company pc's nothing else .

and what do i need to do this application only java and oracle sql ? or do i need something else .

sorry for my english

Norm Radder wrote:

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 1
   at test.Frame1.btn(Frame1.java:30)


At line 30 the program used an index of 1 with an array that did not have at least 2 elements.  Make sure the array is large enough and that the index value does not go past the end of the array.

Note:  The test for the end of the looping in the for statement should use < not <=.  The max index for an array is the length-1.

Also the btn array should be defined and given a length outside of the loop, not inside like is done on line 7.  Line 7 changes the contents of btn every iteration of the loop.  Anything put into the btn array following line 7 will be lost when a new btn array is created next time around on line 7.



The problem the same code worked for my friend but it's not working for me (i am so confused and got a headache thinking about this) . LOL

we have done the same steps but it's working for him and doesn't work for me .

i guess i'll leave it for now and make something else . ^^
5 years ago

Norm Radder wrote:

can you try the code


Yes, if you can make a small, complete program that compiles and executes and shows the problem.  The code should not include any database or anything not related to the problem:  adding multiple labels to a panel after the original window has been shown.





i did something like this but it doesn't work at all , now i get error exception :



am i doing something wrong ?
5 years ago

Norm Radder wrote:

it doesn't seem to work for me


What  does "doesnt" mean? What happens when the code is executed?
How many buttons are shown?
Where is jPanel4 supposed to be shown?   When is jPanel4 repainted to show the buttons that have been added to it?

Can you make a small, complete program that compiles and executes and shows the problem?    It only needs to have jPanel4 and a container to hold it.  No database or anything else.  Only the bare minimum that shows the problem.



it doesn't show any button , also jPanel4 is the Database Table shown in picture , what does repaint have to do with this method ?

i have tried it in test class it doesn't work also , it doesn't show any error on compile , my container is jScrollPanel to hold the jPanel4 so i can scroll up and down .

can you try the code yourself and see if it works ?
5 years ago
I am trying to get Database Table names and how many tables my database have then add the same number of tables for example 7 tables = 7 buttons .
what am i trying to do is making a Database Tool which gets how many tables do i have in database using the username "HR" and then it creates to me when i connect to database it creates to me 7 buttons in jpanel .

Here is my code but it doesn't seem to work for me :

Variables :







here is the logic : when i connect to database using a connect button it goes to database and check for how many tables i have if they are 7 , it creates a 7 buttons in jpanel then these 7 buttons goes to another form .

here is a picture from what am i trying to do :



my problem is what is wrong with my btn method it doesn't seem to work .
5 years ago
sorry for double post but there is no edit here ,

i will do a setting that will let the client choose GUI color and background image this is why i want to generate the form into a button then save it into a file then when he creates his background color or image and font color for his choice it saves the GUI with the client choosed colors so the client be satisfied when he creates his own GUI color thats why i want to know how to put GUI Into a button .
5 years ago

Stephan van Hulst wrote:Yes, this is possible, but it's really not recommended. Why would you couple a form so tightly to a button? Why don't you want to leave it up to client code to decide how the form is summoned? What makes you think this will affect performance in any way?



it will help with doing Database tools with java , it helps alot in this kind of stuff , by doing a button getting table name then adds a button for each table they have in database when they click on this button it will automaticly generate a form with database information with Insert , Delete , Update , Search (in JTable) .

im trying to learn but it comes to mind that you can make tools with this method .
5 years ago
Hello , i have come to an idea to make a program performance even better also it creates less forms so we can create a bigger tools , but my question is how can i copy GUI Components and paste it in a button i have tried to copy the whole class jframe code and paste it inside a button but it gives me an error .

i mean i want to copy a GUI from static to dynamic here is an example :

i created a new Form then added jpanels , labes , buttons , textfields etc.

after that i want to copy this form in a Single Button and delete the form itself from the project so when the user click on this button it opens the form with the same components i added in the GUI .

how is it possible to make that happens ?

i am trying to figure out how can i do this but there is no luck for me :/
5 years ago
i'll try to study streams if it can improve this code

i'll try also to improve this code and post it here ^^
5 years ago
it's working now i'll have to study toString() method i didn't knew that it return the type then prints it :

here is the code :

MainClass :



Employee Class :



Manager Class :



Thank you so much Liutauras Vilda for these methods i learned alot of things from this Task it is thanks to you ♥ ☺ ♥
5 years ago
i really cannot figure out how to solve this if someone know how to solve this issue please post the right code .

i know the problem in getEmployee() method because it return the same value but how can i make it save values in arraylist then add a new input for next employee , i have tried foreach & for & while & do while nothing seems to work please someone help me .
5 years ago