• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

should i lower the bar?

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Bartender
Posts: 689
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic