• Post Reply Bookmark Topic Watch Topic
  • New Topic

should i lower the bar?  RSS feed

 
Matthew Joseph
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just finished my beginning java class, and i want to continue on my own. The real problem i am having is thinking of a program idea that can actually be useful to me.
i work in IT, so i am thinking about a GUI with a lot of the tools that i normally use (ping, nslookup,etc). So i have a couple of questions:

1. Are there libraries that integrate with a business domain network?
2. Is is possible to achieve without learning a second language like powershell?
3. Am I biting off more than i can chew?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37496
547
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) I'm not sure what you mean

2) You don't need to learn PowerShell. Java can run operating system commands (think DOS/UNIX command line or wherever you type "pijng" now.)

3) I think this is something you'll be able to do. You'll have to learn about JavaFX or the like to make the GUI. I recommend starting with a command line program to get the logic working before adding a GUI.
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Sorry, not following you but here is my shot.
I think you are talking about Socket programming. If yes, then have a look at java.net package in the JDK.

2) You don't need to learn PowerShell or what so ever.

3) As Jeanne said. If you decided to do GUI client, then JavaFX worth the try indeed. And if you want to start with a CLI, then this might come in handy: Apache Commons CLI
 
Matthew Joseph
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, what i mean for #1 is this:
i have the network admin password at work. a number of command line instructions require you to run cmd as administrator.
also, a lot of things(like moving/creating files) are denied unless you are the administrator.
I was wondering if there are any special things to include to allow that, when writing the program.... i'm not doing a good job
of explaining myself.

Also, a friend told me about swing for gui. would you say javafx is better?
 
Mike. J. Thompson
Bartender
Posts: 689
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your want your java program to be able to do things that require administrator privileges then you will have to run it as a user that has those privileges.

Or for example if you are running on Linux then you can get the administrator to configure the sudoers file to give the application the relevant privileges, and then non-root users can run it under sudo.

You can probably do something similar under windows too. This is all system administrator stuff though, not something that you do in Java.

If your program attempts to do something that requires root access but it doesn't have the right permissions then an Exception will probably be thrown. It would be the programmers responsibility to handle exceptions and inform the user of the error.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37496
547
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matthew Joseph wrote:i have the network admin password at work. a number of command line instructions require you to run cmd as administrator.

Start with things that don't require the admin password! Seriously, you don't want to be experimenting with a new language as an admin.

Matthew Joseph wrote:Also, a friend told me about swing for gui. would you say javafx is better?

According to Oracle, Java FX is replacing Swing. This FAQ says:
6. Is JavaFX replacing Swing as the new client UI library for Java SE?
Yes. However, Swing will remain part of the Java SE specification for the foreseeable future, and therefore included in the JRE. While we recommend developers to leverage JavaFX APIs as much as possible when building new applications, it is possible to extend a Swing application with JavaFX, allowing for a smoother transition.


If the past is any indication, it will be a decade (or forever) before they actually remove Swing. But you are learning from scratch, so you might as well learn the new way first!
 
Matthew Joseph
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have scoured the inter-web, and i return with fresh confusion! Jeanne, you were completely right about starting on the back end first.
It does no good making something pretty if it doesn't actually do anything.

Hessein, thank you for the socket programming tip. The general opinion online is that using ping is a dumb idea, so am trying sockets.
Below is the code I am using. It returns false every time I run it, regardless of what port or address used. Any Ideas on where this approach fails?

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!