Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > opening isdn connection with external file

Reply
Thread Tools

opening isdn connection with external file

 
 
nescafe
Guest
Posts: n/a
 
      02-27-2012
Hello.
Im using netbeans on my linux box but the program will be placed on
windowz box.That's why i use .bat file. I can put this into code but
it's simple to work with .bat file.

Anyway, here is the problem...
I have to open ISDN connection and make the dial.
The connection is in part of local area connection and i can start it
with netsh or devcon. This part is tested and working.
But... to complete the process i have to click on "Dial" button.

Simply put... i start the connection with my java program and connection
awaits dial confirmation click.

How to make this "click" in my java program ?



 
Reply With Quote
 
 
 
 
Jeff Higgins
Guest
Posts: n/a
 
      02-27-2012
On 02/27/2012 06:55 AM, nescafe wrote:
> Hello.
> Im using netbeans on my linux box but the program will be placed on
> windowz box.That's why i use .bat file. I can put this into code but
> it's simple to work with .bat file.
>
> Anyway, here is the problem...
> I have to open ISDN connection and make the dial.
> The connection is in part of local area connection and i can start it
> with netsh or devcon. This part is tested and working.
> But... to complete the process i have to click on "Dial" button.
>
> Simply put... i start the connection with my java program and connection
> awaits dial confirmation click.
>
> How to make this "click" in my java program ?
>

import javax.swing.JOptionPane;

public class OptionTest {

public static void main(String[] args) {

int chosenOption = JOptionPane.showConfirmDialog(
null,
"Confirm dial?",
"ISDN Connection",
JOptionPane.YES_NO_CANCEL_OPTION );

String optionMessage;
if (chosenOption == JOptionPane.CANCEL_OPTION) {
optionMessage = "Cancel option chosen";
}
else if (chosenOption == JOptionPane.NO_OPTION) {
optionMessage = "No option chosen";
}
else if (chosenOption == JOptionPane.YES_OPTION){
optionMessage = "Yes option chosen";
}
else {optionMessage = "Unexpected Option";}

JOptionPane.showMessageDialog(null, optionMessage);
}
}

 
Reply With Quote
 
 
 
 
nescafe
Guest
Posts: n/a
 
      02-28-2012
On 02/27/2012 04:54 PM, Jeff Higgins wrote:
> On 02/27/2012 06:55 AM, nescafe wrote:
>> Hello.
>> Im using netbeans on my linux box but the program will be placed on
>> windowz box.That's why i use .bat file. I can put this into code but
>> it's simple to work with .bat file.
>>
>> Anyway, here is the problem...
>> I have to open ISDN connection and make the dial.
>> The connection is in part of local area connection and i can start it
>> with netsh or devcon. This part is tested and working.
>> But... to complete the process i have to click on "Dial" button.
>>
>> Simply put... i start the connection with my java program and connection
>> awaits dial confirmation click.
>>
>> How to make this "click" in my java program ?
>>

> import javax.swing.JOptionPane;
>
> public class OptionTest {
>
> public static void main(String[] args) {
>
> int chosenOption = JOptionPane.showConfirmDialog(
> null,
> "Confirm dial?",
> "ISDN Connection",
> JOptionPane.YES_NO_CANCEL_OPTION );
>
> String optionMessage;
> if (chosenOption == JOptionPane.CANCEL_OPTION) {
> optionMessage = "Cancel option chosen";
> }
> else if (chosenOption == JOptionPane.NO_OPTION) {
> optionMessage = "No option chosen";
> }
> else if (chosenOption == JOptionPane.YES_OPTION){
> optionMessage = "Yes option chosen";
> }
> else {optionMessage = "Unexpected Option";}
>
> JOptionPane.showMessageDialog(null, optionMessage);
> }
> }
>

ok i will try ,but just to elaborate...
The "isdn window" is external program.
Start / network connections / isdn connection.
 
Reply With Quote
 
nescafe
Guest
Posts: n/a
 
      02-28-2012
/*
* KutinaApp.java
*/

package kutina;
import javax.swing.JOptionPane;
import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;

public class KutinaApp extends SingleFrameApplication {

@Override protected void startup() {
show(new KutinaView(this));
}
@Override protected void configureWindow(java.awt.Window root) {
}
public static KutinaApp getApplication() {
return Application.getInstance(KutinaApp.class);
}

//--------------------------------------------------------------------------
public class JOptionPaneTest1 {

public static void main(String[] args) {
//******** inner class cannot have static declarations ************

launch(KutinaApp.class, args );

//-----------------------
int chosenOption = JOptionPane.showConfirmDialog(
null,
"Call?",
"ISDN",
JOptionPane.YES_NO_CANCEL_OPTION );

String optionMessage;
if (chosenOption == JOptionPane.CANCEL_OPTION) {
optionMessage = "Cancel";
}
else if (chosenOption == JOptionPane.YES_OPTION){
optionMessage = "Confirm";
}
else {optionMessage = "Error";}

JOptionPane.showMessageDialog(null, optionMessage);
}
}
}
-------------------------
I get error : inner classes cannot have static declarations ?
I googleit but all examples are the same and there should be no error.
 
Reply With Quote
 
Jeff Higgins
Guest
Posts: n/a
 
      02-28-2012
On 02/28/2012 02:17 AM, nescafe wrote:
> -------------------------
> I get error : inner classes cannot have static declarations ?
> I googleit but all examples are the same and there should be no error.


<http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html>

 
Reply With Quote
 
Jeff Higgins
Guest
Posts: n/a
 
      02-28-2012
On 02/28/2012 05:56 AM, Jeff Higgins wrote:
> On 02/28/2012 02:17 AM, nescafe wrote:
>> -------------------------
>> I get error : inner classes cannot have static declarations ?
>> I googleit but all examples are the same and there should be no error.

>
> <http://docs.oracle.com/javase/tutorial/java/javaOO/nested.html>
>

<http://en.wikipedia.org/wiki/Swing_Application_Framework>
 
Reply With Quote
 
Jeff Higgins
Guest
Posts: n/a
 
      02-28-2012
On 02/28/2012 02:17 AM, nescafe wrote:
> /*
> * KutinaApp.java
> */
>
> package kutina;
> import javax.swing.JOptionPane;
> import org.jdesktop.application.Application;
> import org.jdesktop.application.SingleFrameApplication;
>
> public class KutinaApp extends SingleFrameApplication {
>
> @Override protected void startup() {
> show(new KutinaView(this));
> }
> @Override protected void configureWindow(java.awt.Window root) {
> }
> public static KutinaApp getApplication() {
> return Application.getInstance(KutinaApp.class);
> }
>
> //--------------------------------------------------------------------------
>
> public class JOptionPaneTest1 {
>
> public static void main(String[] args) {
> //******** inner class cannot have static declarations ************
>
> launch(KutinaApp.class, args );


Try this:
Application.launch(KutinaApp.class, args );

>
> //-----------------------


You probably want to put your Confirm Dial-out in an action.

> int chosenOption = JOptionPane.showConfirmDialog(
> null,
> "Call?",
> "ISDN",
> JOptionPane.YES_NO_CANCEL_OPTION );
>
> String optionMessage;
> if (chosenOption == JOptionPane.CANCEL_OPTION) {
> optionMessage = "Cancel";
> }
> else if (chosenOption == JOptionPane.YES_OPTION){
> optionMessage = "Confirm";
> }
> else {optionMessage = "Error";}
>
> JOptionPane.showMessageDialog(null, optionMessage);
> }
> }
> }
> -------------------------
> I get error : inner classes cannot have static declarations ?
> I googleit but all examples are the same and there should be no error.


 
Reply With Quote
 
Jeff Higgins
Guest
Posts: n/a
 
      02-28-2012
On 02/28/2012 08:23 AM, Jeff Higgins wrote:
>
> You probably want to put your Confirm Dial-out in an action.
>

You may want to consider options other than the obsolete Swing
Application Framework.

 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      02-28-2012
On 02/27/2012 11:17 PM, nescafe wrote:
> /*
> * KutinaApp.java
> */
>
> package kutina;
> import javax.swing.JOptionPane;
> import org.jdesktop.application.Application;
> import org.jdesktop.application.SingleFrameApplication;
>
> public class KutinaApp extends SingleFrameApplication {
>
> @Override protected void startup() {
> show(new KutinaView(this));
> }
> @Override protected void configureWindow(java.awt.Window root) {
> }
> public static KutinaApp getApplication() {
> return Application.getInstance(KutinaApp.class);
> }
>
> //--------------------------------------------------------------------------
> public class JOptionPaneTest1 {
>
> public static void main(String[] args) {
> //******** inner class cannot have static declarations ************


Since you declared 'JOptionPaneTest1' (terrible name) inside another type
without the 'static' keyword, it's an inner class, not a static nested class.
Inner classes cannot have static members. You declared a static member
'main()' within that inner class. Just like the message says, inner classes
cannot have static declarations.

Very straightforward.

> ...
> -------------------------
> I get error : inner classes cannot have static declarations ?
> I googleit but all examples are the same and there should be no error.


As Jeff suggested, the tutorial is a great place to start. After that, GIYF, too.

--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedi.../c/cf/Friz.jpg
 
Reply With Quote
 
Jeff Higgins
Guest
Posts: n/a
 
      02-28-2012
On 02/28/2012 12:24 PM, Lew wrote:
> On 02/27/2012 11:17 PM, nescafe wrote:
>> /*
>> * KutinaApp.java
>> */
>>
>> package kutina;
>> import javax.swing.JOptionPane;
>> import org.jdesktop.application.Application;
>> import org.jdesktop.application.SingleFrameApplication;
>>
>> public class KutinaApp extends SingleFrameApplication {
>>
>> @Override protected void startup() {
>> show(new KutinaView(this));
>> }
>> @Override protected void configureWindow(java.awt.Window root) {
>> }
>> public static KutinaApp getApplication() {
>> return Application.getInstance(KutinaApp.class);
>> }
>>
>> //--------------------------------------------------------------------------
>>
>> public class JOptionPaneTest1 {
>>
>> public static void main(String[] args) {
>> //******** inner class cannot have static declarations ************

>
> Since you declared 'JOptionPaneTest1' (terrible name) inside another
> type without the 'static' keyword, it's an inner class, not a static
> nested class. Inner classes cannot have static members. You declared a
> static member 'main()' within that inner class. Just like the message
> says, inner classes cannot have static declarations.
>
> Very straightforward.
>
>> ...
>> -------------------------
>> I get error : inner classes cannot have static declarations ?
>> I googleit but all examples are the same and there should be no error.

>
> As Jeff suggested, the tutorial is a great place to start. After that,
> GIYF, too.
>

Huh, it's so funny how my feeble little mind works (or doesn't) sometimes.
Despite the OP's code sample , error message, and pointer to the line
where the error occurred; I completely missed the public class
JOptionPaneTest1 declaration!
Thanks.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CISCO 804 & ISDN PPP connect ISDN PMP BE749309 Cisco 0 06-09-2010 03:20 PM
VoIP to ISDN (to use old ISDN phones over VoIP) ? Martin Maurer UK VOIP 5 11-07-2008 02:35 PM
pc with isdn modem not connecte isdn 1841 router with isdn module sync Cisco 0 06-05-2007 10:10 AM
Cisco ISDN to Windows RAS ISDN SkY Cisco 0 03-31-2005 08:06 AM
Can you have failover to ISDN in a bridging environment with a standalone ISDN box? BobCov Cisco 3 11-21-2003 06:11 PM



Advertisments