Setting TextArea tabstop in Java 1.1.8

I need to change the tabstop in a TextArea component - default seems to be 8 - too large for small screen of a Pocket PC - anyone know how I might set it to 2?
Thanks,
Bruce

Good idea. I trapped the Tab key and wrote a function using GetFontMetrics for the TextArea to calculate the number of spaces I need for a tab as I am using proportional fonts (your idea would work fine with fixed fonts - I just needed to modify it a bit.) It works well.
Thanks for the idea...

Similar Messages

  • How to set proxy authentication using java properties at run time

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

  • How to do set apps context in java concurrent program

    Hi,
    Can any body help me in setting apps context in Java Concurrent program. I tried using AppsContext class and methods but did not work.
    Thanks for help in advance
    Pavan

    Go on Unix box at $JAVA_TOP/oracle/apps/iby/scheduler
    You will get class file FDExtractAndFormatting.
    Decompile it to get source code.
    Thanks, Avaneesh

  • How do I use a JDBC Resource set-up in Sun Java System Appliation Server?

    How do I use a JDBC Resource set-up in Sun Java System Appliation Server 8.2?
    I created a JDBC Resource labeled "jdbc/__PetroPool" that is backed by a Connection Pool labeled "PetroPool".
    Since this is set-up in Sun Java System Appliation Server 8.2, I am looking for suggestions, examples or guides on how I can use this connection.
    I've been browsing the developer's guide for Sun Java System Appliation Server 8.2 without much luck.
    Googling really doesn't provide a lot of useful information either...
    Any suggestions, examples or guides on how I can use this connection is greatly appreciated.
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    How do I use a JDBC Resource set-up in Sun Java System Appliation Server 8.2?
    I created a JDBC Resource labeled "jdbc/__PetroPool" that is backed by a Connection Pool labeled "PetroPool".
    Since this is set-up in Sun Java System Appliation Server 8.2, I am looking for suggestions, examples or guides on how I can use this connection.
    I've been browsing the developer's guide for Sun Java System Appliation Server 8.2 without much luck.
    Googling really doesn't provide a lot of useful information either...
    Any suggestions, examples or guides on how I can use this connection is greatly appreciated.
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to dynamically configure JPA setting at runtime using java code?

    Hi,
    I am new to EJB 3.0 and JPA. I am trying to help my company to deploy the use of JPA in EJB3.0. Currently, i am trying out with OpenJPA in IBM Webshpere Application Server 7.0. We have four different WAS servers running for testing, system integration testing, user testing and production respectively, and in each region, the configurations for data source, JDBC username and password, schema, etc are different. So i think i would need to configure the JPA setting during runtime using Java code that determines which is the environment. And apparently i am stuck with the limited knowledge i have.
    1) I understand that i could override the JDBC in the persistence xml by creating entity manager using entity manager factory. But is it possible that i do similar thing by using inejction of persistence context on entity manager to obtain a container managed entity manager?
    2) Alternatively, it is possible to create multiple persistence unit in the XML and inject different PU to the entity manager, am i right? But how to inject dynamically since @PersistenceContext(unitName="xxx") only accepts constant declaration.
    3) Is it possible that the JDBC username and password are read from properties file?
    Thanks for your help in advance!

    Hi
    Thanks for the reply.
    Are you saying that i have to configure the data source authentication to the backend DB2 using the JAAS-J2C? Correct me if i am mistaken. I guess i am unable to do so as the application server setup only contains one data source, and the server hosted a number of applications. Every applications has their own JDBC username and password supply to the data source (the ID supplied at the DB2 side will decide which resource can access) and thus, i have to supply the username and password at runtime. Talked to the server guy and seems that it is not feasible to have seperate datasource for each applications as considered to the volume of applications hosted inside the server.
    Any suggestion?

  • How to set applet  parameter in java code?

    Hi All,
    Instead of setting applet parameters in JSP page, Now I have a need to set
    applet parameters in java code. But I can't find a method that allow me to do this. There
    is only getParameter but seems no setParameter method.
    Any help is appreaciated.
    Thanks,
    Chris

    Take a look at set_custom_property:
    public static final ID SETTEXT = ID.registerProperty("SETTEXT");
    public boolean setProperty(ID pid, Object value)
        if (pid == SETTEXT)
    String text = value.toString();
    and in forms
    set_custom_property('beans.bean_item', 1, 'SETTEXT', 'some text');
    cheers

  • Load an Advanced Print Setting in Acrobat via Java-Script

    Hi there,
    I'd like to know, if there's a way to load an advanced print setting in the Acrobat via Java Script or some other way? (See Screenshot)
    Or is it possible to set an created setting as default-setting? (also via Java or something)
    Or can somebody tell me, where these created print settings are saved? (in Acrobat X)
    Thank you very much for your help and sorry for my english, I hope you understand me. :-)
    Kind regards
    Mankro

    Why wouldn't you want to set itas part of an input/output parameter?
    This is really the right way ofdoing this. Otherwise you'll end up with hardcoded variable name in your customcomponent and that not ideal.
    If you're trying to define a default value for it coming from a properties file, you can just make it a "Configuration" variable and set the value from adminui.
    Jasmin

  • How to set iframe src from java dynammically

    Hi,
    Iam calling a servlet from jsp and servlet calls the databse query and returns the value,
    in my jsp i have ifrme, i want to change the source of iframe from java depends on the result from database , and the result must display on the iframe can any one tell me how to do this

    aurelian_cl wrote:
    I need to know how to set environment variables from java
    I want to set from java for example the environment variable "TestVar" with the value "TestValue"!1) That functionality does not belong in an application. You're trying to set environment variables, which are global across all applications, at either the user level as a whole, or across the entire machine (system level). Or, if you're only trying to set a variable active for the current process, you don't need to do that.
    2) Environment variables are not a platform-independent entity, and are thus against the nature of Java.
    My gut feel is that you are designing something in a backwards way, so my point is mainly to point that out, not to try to help you solve that particular problem.

  • How to set variable to run java and j2ee

    how to set variable to run java and j2ee

    Please ask a specific and comprehensible question. Consider describing with less vagueness the actual current problem that you are encountering.

  • Setting textArea and Button Size

    Hi with a TextArea is there a way to set the text area so that you only can type in the box and the words will wrap when they get to the end? I dont want the text that a user types to keep on extending until the user click enter which brings them to the next line. I want it so that when the user hits the end of the text box in the applet they are brought to the next line of the text box without having to hit enter. i dont want them to have to scroll to see all of thier text.
    Also can I use a constructor to resize the default buttons created with java? i want my buttons to be a ceratain square size to fill the applet. The Default Buttons are small but I want my Buttons to fill a section of my panel. Here is my code. I am using a grid layout.
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.lang.*;
    import java.math.*;
    public class TextChat extends Applet
       private Button new_chat, begin;
       private Label errors;
       private TextArea text_top, text_bottom;
       public void init()
          //Set Layout
          setLayout( new GridLayout(3, 1, 10, 10));
          text_top = new TextArea();
          text_bottom = new TextArea();
          add (text_top);
          add(MidPanel());
          add (text_bottom);
       // Set Mid Panel
       public Panel MidPanel()
          Panel p = new Panel( new GridLayout(1, 3, 5, 5) );
          //Set up Buttons
          new_chat = new Button("New Chat");
          begin = new Button("Begin");
          errors = new Label("Errors: ");
          Panel p1 = new Panel();
          p1.add(new_chat);
          Panel p2 = new Panel();
          p2.add(begin);
          Panel p3 = new Panel();
          p3.add(errors);
          p.add(p1);
          p.add(p2);
          p.add(p3);
          return p;
    }Thanks

    I tried this
    TextArea text_top = new TextArea();
    TextArea text_bottom = new TextArea();
    text_top.setLineWrap(true);I get a error
    method setLineWrap (boolean)
    It points to the text_top"."setLinewarp as the
    error?
    I looked up examples and they all used swing
    ThanksThe examples might use swing but you are using AWT!!
    change to
    JTextArea text_top = new JTextArea();
    JTextArea text_bottom = new JTextArea();
    text_top.setLineWrap(true);

  • Setting timeout property in java client using corba

    Hi all,
    We are facing a problem regarding corba timeout. We have a java based client (jdk 1.5), which connects to a cpp server using corba. Now we want to set a timeout at client side if some call takes a long to come back (due to TCP/IP connection problem or any other reason). We are using borland's visibroker and implemented their 'RelativeRequestTimeoutPolicy' policy but it gives an exception like this : org.omg.CORBA.PolicyError: There is no PolicyFactory Registered for type 31
    I have searched this forum for the same but could not find any particular solution or may be I was unable to find that. Can anyone please help regarding this issue? Is there any SUN specified property that can be used? What is the use of 'com.sun.CORBA.transport.ORBTCPReadTimeouts'? Can anyone help?.

    Hi ,
    I am getting the same exception org.omg.CORBA.PolicyError: There is no PolicyFactory Registered for type 31
    at com.sun.corba.se.internal.Interceptors.PIORB.create_policy
    Below is source code :
    long relative_expiry = 30L * 10000000L; // 30 seconds
    Any relative_request_timeout_value = orb.create_any();
    TimeTHelper.insert(relative_request_timeout_value,relative_expiry);
    Policy policies = orb.create_policy(org.omg.Messaging.RELATIVE_REQ_TIMEOUT_POLICY_TYPE.value,relative_request_timeout_value);
    PolicyManager orbManager = PolicyManagerHelper.narrow(
    orb.resolve_initial_references("ORBPolicyManager"));
    orbManager.set_policy_overrides(new Policy[] {policies},SetOverrideType.SET_OVERRIDE);
    Please let me know how the problem was resolved

  • A way to set a flag in java layer when native method has been called?

    Hi,
    I'm calling a native method from the java layer through to a native c function. Is there a way I can set a flag in the java layer when this native method has been called?
    Thanks!

    1. Create a wrapper method. The wrapper method is the only exposed method. It calls the native method. It sets the flag.
    2. Set the flag in the native method itself.
    3. You might be able to use the debugging API to do this however it is going to require quite a bit of work. And it injects itself at runtime.
    Is there a reason for this request? There might be other solutions if a general problem was posed.

  • How to set portal context using Java/JPDK api.

    Hi,
    I am in the process of converting pl/sql based database provider contect portlets to Java based JPDK. I ran into issue where the database provider portlet users were getting context auto matically. Now with Java/JPDK portlets , I am receiving no data found error, since the context is not set. The pl/sql is setting wwctx_private_api.set_context ('portal') to set the context. From Java if we call this api, it is taking a toll on the performance and the portlet times out.
    Can any help how to set the context for a web provider using JPDK or any other better solution. Any immediate help is highly appreciated.
    Thanks,
    Rav.

    Hi
    We are trying to access content views for e.g portal.wwsbr_all_items s, portal.wwsbr_all_content_areas c,portal.wwsbr_all_folders f, from aweb provider portlet. When we do a select on those objects , we are getting java sql exception saying "ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "PORTAL.WWCTX_SSO", line 1745
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "PORTAL.WWCTX_SSO", line 1579
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "PORTAL.WWCTX_SSO", line 1834
    ORA-06512: at "PORTAL.WWCTX_API", line 199
    We need to know how to accesss the above views from a jsp based portlet.
    A

  • How to set FOCUS on applet (java-plugin)

    I wrote applet using Java 1.3.1, using swing clasess.
    I use java-plugin, defined in <object ..> and <embed ..> tags as described in documentation,
    with MAYSCRIPT parameter and ID and NAME parameters defined.
    How to set up focus on this applet through JavaScript?
    I have tried:
    document.embeds[0].focus()
    document.applets.MyApplet.focus()
    document.objects.MyApplet.focus()
    document.objects[0].focus()
    document.MyApplet.focus()
    But nothing works in my IE5.x or NC4.7. Applet itself works fine.
    Is some special methods need to be defined in JApplet to catch the focus?
    Thanks for any advice.

    I wrote applet using Java 1.3.1, using swing clasess.
    I use java-plugin, defined in <object ..> and <embed
    ..> tags as described in documentation,
    with MAYSCRIPT parameter and ID and NAME parameters
    defined.
    How to set up focus on this applet through
    JavaScript?
    I have tried:
    document.embeds[0].focus()
    document.applets.MyApplet.focus()
    document.objects.MyApplet.focus()
    document.objects[0].focus()
    document.MyApplet.focus()
    But nothing works in my IE5.x or NC4.7. Applet itself
    works fine.
    Is some special methods need to be defined in JApplet
    to catch the focus?
    Thanks for any advice.With IE you should try the following:
    <OBJECT id='MyApplet' ...
    document.MyApplet.requestFocus();
    This worked fine for me, even without specifying additional "MAYSCRIPT" or "scriptable=true" tags. Obviously this construct managed to call the public Java method "requestFocus()" from JavaScript.
    Maybe something similar would also work for Netscape. I felt no need to do this when running in Netscape, because the Netscape browser handled focus management without problems.
    For IE I tried to workaround a problem mentioned by several people in this forum: The focus will not be regained by an applet when the user switched form IE to another application and then returns back to the browser window which contains the applet.
    Unfortunally the following code fragment worked only partially well:
    function activated()
    if (isIE)
    document.MyApplet.requestFocus();
    return true;
    window.onfocus = activated();
    OnFocus is invoked only each second time when the browser window gains back focus.
    I'm still looking for a real solution, so I'd appreciate if anybody could come up with one.
    Hope this helps a bit
    Bernd

  • Set system classpath using java program??

    Hi,
    I want to set the System classpath using java program. Can somebody please tell how to do this.
    Prashant

    but this will set the classpath for that particular JVM only.
    Isn't it??? I want that of SYSTEM so that user can access that class path from any JVM instance.
    Prashant

Maybe you are looking for

  • Fields are getting displayed two times in alv grid

    Hi experts, I have developed an interactive alv. in basic list i have given two push buttons. if first button is selected it should display one list and second button is selected another list. I am displaying all the three lists using the FM 'REUSE_A

  • Visual voicemail does not work anymore

    For 3 days I cannot access visual voice mail anymore, I touch a message and just nothing happens. I can dial 1 and access mailbox the classic way though. Interesting, when I get a new voice mail I can listen exactly once but then no more. I have been

  • TS3694 how can i overcome error message 1015 which pops when trying to restore an iphone 3g?

    While doing a restore of my 3g iphone, i get error message 1015, and the phone is frozen at the loading mode. can someone help me fix this problem with a windows 7 ?

  • Help with sharing on dual layer in final cut pro x

    I am struggling to share on a dual layer disc using final cut pro X it says that the sharing has stopped and that there must be a problem with the disc? but when I share onto a single layer disc its all fine

  • Dba_scheduler_jobs for clearing the sys audit table

    Hi. can u please tell me how to purge a sys.aud$ table records once its reached more than once lakh ... these 1 lakh is the threshold and other more data will be peridiodically purged by automated dba_scheduler_jobs. My db is - 10g so i need to alway