Accessing showVerticalLines in JTable class....

hi,,
having trouble with this protected field.
i have a simple request, i do not want vertical lines in
my table, thats all.
but i cannot access the protected field showVerticalLines.
ive extended JFrame and Jtable is not an interface
so i cant implement it, i'm looking for any type of work around.
thanks.
code snipet:
public void displayResults(final String selected)
Object headers[] = {"Id", "Filename"};
Object data[][] = db.getResults(selected);
TableModel tModel = new DefaultTableModel(data, headers){
          //make read only
     public boolean isCellEditable(int x, int y){
          return false;
JTable tableList = new JTable(tModel);
tableList.showVerticalLines = false; // does not allow
ListSelectionModel selectionModel = tableList.getSelectionModel();
selectionModel.setSelectionMod
(ListSelectionModel.SINGLE_SELECTION);

you have the setShowVerticalLines(boolean b) method in JTable

Similar Messages

  • Loading XML using a custom class and accessing it from other classes?

    I began with a class for a movie clip rollover function
    FigureRollOver. It works marvellously. Three things happen:
    1) it loads XML from a file "mod1_fig1.xml" and uses another
    class, XMLMember, to retool the scoping of the XML so that I can
    get at it
    2) an onload call inside of XMLMember calls the myOnLoad
    function and transfers the XML into an array.
    3) so long as the array is finished building, rolling over a
    movie clip attaches a new movie clip with the rollover text in it.
    But I don't want all those functions in one because I need it
    to be more dynamic, starting with being able to load any old xml
    file instead of just "mod1_fig1.xml", plus it seems like
    overbuilding to have all of that in one class, so I've separated
    out the loading of the XML and building of the array into its own
    class, FigureXMLLoader. FigureRollOver is then left to just attach
    the rollover with text in it, extracted from the array built by the
    new class.
    Problem is, though the array builds inside FigureXMLLoader, I
    can't figure out how to make it available outside the class. I know
    that I'm constructing things in the wrong order, and that the array
    needs to be somehow built inside the class function to be
    available, but I can't figure out how to do that. A cruddy
    work-around is to put a function call at the end of the building of
    the array, which calls yet ANOTHER function on the main timeline of
    my .swf to put the array I've just built into a new variable. This
    works, but it's messy. It seems like I should be able to have one
    line of script in the .swf that generates an array on the main
    timeline (or just a public array) which I can then access from my
    FigureRollOver class:
    var myRollOvers:Array = new FigureXMLLoader("mod1_fig1.xml");
    Here is FigureXMLLoader (see comments in the code for more
    details) which obviously does not return an array as it is, because
    of all the working around I've had to do. Note the "testing"
    variable, which can be traced from the main timeline of the .swf,
    but I will get "not what I want" because of course the array hasn't
    been built yet, and never will be, inside of the declaration as it
    is. How do I get it in there so I can return an array?
    Thanks!

    Suggest you ask this question in the Actionscript forum as
    this forum is
    more tuned to database integration questions.
    You can create arrays outside a class and pass them into it
    by reference and
    visa versa build arrays inside a class and pass out via
    reference.
    The preferred approach is to place the array in a class and
    not expose it.
    Then add methods to use the array or should we say to use the
    class.
    Lon Hosford
    www.lonhosford.com
    Flash, Actionscript and Flash Media Server examples:
    http://flashexamples.hosfordusa.com
    May many happy bits flow your way!
    "maija_g" <[email protected]> wrote in
    message
    news:ed4i43$9v0$[email protected]..
    > Update: I've now put this on the main timeline of the
    .swf:
    >
    > myRollOversLoaded = false;
    > var myRollOvers:Array;
    > var roll_content = new FigureXMLLoader("mod1_fig1.xml");
    >
    > And inside the "myOnLoad" function in FigureXMLLoader,
    just after the
    > while
    > loop I've put this:
    >
    > _root.myRollOversLoaded = true;
    > _root.myRollOvers = figure_arr;
    >
    > The movie clip rollover won't act until
    myRollOversLoaded is true. It
    > works,
    > but it still seems klugey. Any suggestions for a more
    elegant solution
    > would be
    > appreciated.
    >

  • Why only final variables can be accessed in an inner class ?

    Variables declared in a method need to declared as final if they are to be accessed in an inner class which resides in that method. My question is...
    1. Why should i declare them as final ? What's the reason?
    2. If i declare them as final, could they be modified in inner class ? since final variables should not modify their value.

    (Got an error posting this, so I hope we don't end up with two...)
    But what if i want to change the final local variable within that method instead of within anonymous class.You can't. You can't change the value of a final variable.
    Should i use same thing like having another local variable as part of method and initializing it with the final local variable?You could do. But as in the first example I posted you are changing the value of the nonfinal variable not the final one. Because final variables can't be changed.
    If so, don't you think it is redundant to have so many local variables for so many final local variables just to change them within that method?If you are worried that a variable might be redundant, don't create it. If you must create it to meet some need then it's not redundant.
    Or is there any alternate way?Any alternate way to do what?

  • Accessing variable from another class

    Say I want to access String ABC from class XYZ from my main class. I have already created the object for the class I just don't know the syntax for accessing the variable.
    This is just an example. I figured this is just a problem of finding the right syntax so I didn't bother creating a compiling code.
    public class test{
    public static void main(String[]args){
         XYZ xyz = new XYZ ();
         String a = abc.XYZ(); // this is where i want to directly access the variable abc. i know this isn't correct and it's what im trying to find out how to do.
    public class XYZ{
         String abc = "hi";
    }Edited by: aznprdgy on Nov 3, 2009 2:13 PM

    No, that isn't possible.
    abc is said to be a local variable. And it's only useable within method().
    It's part of the job of the class Xyz to control the access to its state. As an example:
    public class Test {
        public static void main(String[] args) {
            Xyz xyz = new Xyz()
            String a = xyz.getSpecialValue();
    public class Xyz {
        private String a;
        public String getSpecialValue() {
            return a;
        public void method() {
            a = "hi";
    }Note that a won't be reference to the string "hi" until after method() has been called.

  • Accessing httpsession in ApplicationModule class

    is it possible to get a hold off httpsession in a class that extends ApplicationModuleImpl.
    i can't seem to access FacesContext from this class. Where do i add the faces-impl.jar to, in order to get access to this api.
    thanks

    What are you trying to achieve?
    It seems that you are trying to break the MVC architecture.
    Your Model layer shouldn't be accessing your view/controller layer since then it looses its independence.
    Instead the correct way to do what you are trying to do is write the code in the Controller layer. The controller layer has access to both the httpSession and the application module.
    It can pass information from the http session to a service method of the application module.
    For example:
    http://download.oracle.com/docs/html/B25947_01/bcservices005.htm#sthref681

  • Instantiation access to other java classes

    Hello,
    I have a public Java file in my package.
    I want to grant access to only classes of my choice to instantiate my class, irrespective of any package(my constructor is public itself).
    Is there any way?
    eg:
    I have MyJava.java in com.abc;
    I want to give access only to 2 classes even though other classes exist in the same package:
    YourJava1.java in com.abc; (there are other classes in this package)
    YourJava2.java in com.xyz; (there are other classes in this package)
    Thanks.

    Hi,
    I'm not sure about your depths in java knowledge... however, I'm gonna try to help you based on my knowledge...
    whenever "public" modifier will be used any case( doesn't matter if it is Class, method or attributes), it will be visible from any package level. That is the Rule. If you make your constructor as public, then it always be accessible for any class regardless the package level. Otherwise, it would defeat the purpose of "public" modifier.
    Its depends on your business logic why you are trying to do this scenario. But, there are couple of ways to solve the problem...
    Make "MyJava.java"constructor as "protected" AND move whichever class needs to have handle on it into the same package(in this case: "YourJava1.java" and "YourJava2.java"). Thats how only those classes will be able to instantiate "MyJava.java". you may have multiple constructor and one of them can be "public" so that this object also can be accessed from outside of the package...
    Another option might be - make "MyJava.java" as an Interface or an abstract class. So that you can implement it whichever class needs it. This is how you can restrict it someway...
    Hope it helps...

  • Restricting class access to only some classes.

    Hi Guys,
    I want my classes to be accessed by only my defined classes. Is it possible?
    Say I have public class defined test. I want that this class should be accessed by only the classes I want not by any other class by any mean. If somebody tries to access the class it should result in SecurityException. How can I do that???
    Thanks,
    Rajan

    maybe a package private class will do it, ie package the classes in the same package. define the particular class as protected, it will be visible to other classes in the package, the other classes maybe public.
    otherwise maybe it is an protected abstract class that the others extend?
    otherwise have this particular class take as arguments the other classes in overloaded methods?
    otherwise maybe a strategy pattern and default is a do nothing class (ie throws)?
    ...

  • Private, protected Access Modifiers with a class

    Why cant we use private and protected access modifiers with a class?
    Thanks.

    Matiz wrote:
    >
    Public access allows you to extend a parent class in some other package. If you only want users to extend your class rather than instantiate it directly, make the class abstract and design for extension.Agreed. However, would the same argument be not true for the default access at the class level? No. Default access would only allow you to extend a parent class in the same package (as opposed to some other package).
    Now my confusion is why is a class allowed default access at the top level and not protected?Because protected for a top-level class makes no sense. The protected keyword provides member access to any other class in the same package and extending classes outside the package. A top-level class isn't a member of a class, by definition, so there's nothing that protected would do provide differently than public.
    So, the two access modifiers for a top-level class are public and default. Public allows access to the class outside the package, whereas default restricts access to the class within the package.
    ~

  • Access a normal java class from EJB

    how can i access normal java class from an EJB.
    I do not want to write the business logic inside the EJB. How can I achieve this.

    There's no special API for doing this. Just use normal java. E.g.
    @Stateless
    public class FooBean implements Foo {
    public void foo() {
    // access non-EJB utility class Bar
    Bar b = new Bar();
    b.bar();
    }

  • Error Msg. I am receiving an error message:   "Access to "DDRC-Computer Class" in "Birthdays" in account "iCloud" is not permitted. The server responded: "403" to operation CalDAVWriteEntityQueueableOperation. Revert to server /Go offline.

    I am receiving an error message:
    "Access to “DDRC-Computer Class” in “Birthdays” in account “iCloud” is not permitted.
    The server responded:
    “403” to operation CalDAVWriteEntityQueueableOperation.
    Revert to server /Go offline.
    When I click  revert to server the screen goes back to the same error message.  When I click go off line the error message disappears, but none of my calendar appts. sync with my other devices.

    We previously had a similar issue when migrating multiple accounts from MobileMe to iCloud.  The issue was resolved by disabling and then enabling iCal sync through iCloud on our iMacs in System Preferences.
    Always backup your calendar before troubleshooting (File > Export > iCal Archive).
    The following steps are roughly from a Apple Support Community discussion.
    Open iCloud in System Preferences.
    Switch off (uncheck) iCal sync in iCloud System Preferences pane.
    Backup iCal before doing this. You will need to remove calendar data.
    Open iCal and verify the iCloud account is removed in the iCal preferences under accounts.
    Close iCal, reopen System Preference and switch on (check) iCal sync in iCloud System Preferences pane.
    Reopen iCal and verify the iCloud account is enabled in the iCal preferences under accounts.
    At this point if the problem persists you might try completely signing out of iCloud and then signing back in. But remember to backup all related data (iCal, Contacts, Mail, Photostream, etc) before turning off iCloud sync!

  • How to restrict VK11 access based on condition class D (Tax)

    hi ,
    I have a requirement to restrict VK11 access based on condition class D (Tax). Because all users should not have access to maintain tax data in VK11 while general pricing data they can maintain. when condition class is D then we should have control.
    Thanks
    Akhilesh

    Hi Akhilesh,
    Please find the below link and click on View article.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a92195a9-0b01-0010-909c-f330ea4a585c
    how to create authorization object?
    Thanks
    Dasaradha

  • How can I Access the Flash "Slide class" using flex and ActionScript 3?

    Hi,
    I hope someone can help me solve a problem...
    I'm using the flex SwfLoader to load a flash side
    presentation as follows...
    <mx:SWFLoader id="ss_slides" source="ss_slides.swf"
    width="320" height="240"/>
    I would like to access the flash "Slide Class" using flex so
    I can make the following call...
    Slide.gotoNextSlide();
    Anyone know how I can do that?
    Would it be through the SwfLoader Object?
    Is there another way?
    F.Y.I. Here is a snippets about the Slide class from the
    Flash 8 help...
    Using the Slide class (Flash Professional only)
    You use the methods and properties of the Slide class to
    control slide
    presentations you create using the Screen Outline pane for a
    Flash Slide
    Presentation, to get information about a slide presentation
    (for example, to
    determine the number of child slides contained by parent
    slide), or to navigate
    between slides in a slide presentation (for example, to
    create "Next slide" and
    "Previous slide" buttons).
    You can also use the built-in behaviors that are available
    in the Behaviors
    panel to control slide presentations. For more information,
    see Adding controls
    to screens using behaviors (Flash Professional only) in Using
    Flash.
    Thanks,
    Chris S.

    Hi Chris,
    You cannot access the methods of the Flash 8 movie from Flex.
    And you can't do it the other way around either.
    The only way to communicate is to create a LocalConnection on
    each side.
    M.

  • Axis Fault: JavaProvider can not access a member of class Hello with mod.

    Hi,
    I am getting the following Axis Fault with content
    Exception in thread "main" AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: java.lang.IllegalAccessException: Class org.apache.axis.providers.java.JavaProvider can not access a member of class Hello with modifiers ""
    faultActor:
    faultNode:
    faultDetail:
         {http://xml.apache.org/axis/}hostname:SNR143052
    java.lang.IllegalAccessException: Class org.apache.axis.providers.java.JavaProvider can not access a member of class Hello with modifiers ""
         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633)
         at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
         at org.apache.axis.client.Call.invoke(Call.java:2767)
         at org.apache.axis.client.Call.invoke(Call.java:2443)
         at org.apache.axis.client.Call.invoke(Call.java:2366)
         at org.apache.axis.client.Call.invoke(Call.java:1812)
    The client code for the webservice using instant deployment is
    import java.net.URL;
    import javax.xml.rpc.ParameterMode;
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import org.apache.axis.encoding.XMLType;
    import org.apache.axis.utils.Options;
    public class ClientHello {
         public ClientHello(){
         public static void main(String[] args) throws Exception{
              Options options = new Options(args);
              String endpoint = "http://localhost:" + options.getPort()+"/WebServices/Hello.jws";
              args = options.getRemainingArgs();
              Service services = new Service();
              Call call = (Call) services.createCall();
              call.setTargetEndpointAddress(new URL(endpoint));
              call.setOperationName(args[0]);
              call.addParameter("op1",XMLType.XSD_STRING,ParameterMode.IN);
              call.setReturnType(XMLType.XSD_STRING);
              System.out.print(args[1]);
              String s = new String(args[1]);
              String result = (String) call.invoke(new Object[]{s});
              System.out.println(result);
    The hello.jws is as follows
    class Hello {
         public String hi(String message){
              return "Hello "+ message;
    I am not sure why the message is substituted with "" instead of the parameter i have sent in args[1].
    Please help me out in this regard.
    Thanks,
    winkidzz

    Thanks swatdba.
    Any idea on how to proceed with implementing Webservices using Websphere MQ?

  • Reflection problem: can not access a member of class java.lang.IllegalAcces

    package org.struts.ets.utility;
    import java.lang.reflect.Constructor;
    import java.lang.reflect.Field;
    import java.lang.reflect.InvocationTargetException;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import org.struts.bean.FieldTrouble;
    import org.struts.bean.GenericDAOBean;
    public class DynamicObjectCreation
         public static void main(String... args)
              FieldTrouble ft = new FieldTrouble();
              try
                   Class<?> c = ft.getClass();
                   //Class<?> c = FieldTrouble.class;
                   /*Class<?> c = null;
                   try
                        c = Class.forName("org.struts.bean.FieldTrouble");
                   } catch (ClassNotFoundException e)
                        e.printStackTrace();
                   Field f = c.getDeclaredField("var1");
                   //f.setInt(ft, 42); // IllegalArgumentException
                   f.set(ft, new String("A"));
                   System.out.println(ft.getVar1());
                   // production code should handle these exceptions more gracefully
              } catch (NoSuchFieldException x)
                   x.printStackTrace();
              } catch (IllegalAccessException x)
                   x.printStackTrace();
    }// If I put FieldTrouble.java in any other package than the current package I am running this code from. I get the following error:
    java.lang.IllegalAccessException: Class org.struts.ets.utility.DynamicObjectCreation can not access a member of class org.struts.bean.FieldTrouble with modifiers ""
         at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
         at java.lang.reflect.Field.doSecurityCheck(Unknown Source)
         at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
         at java.lang.reflect.Field.set(Unknown Source)
         at org.struts.ets.utility.DynamicObjectCreation.main(DynamicObjectCreation.java:35)
    I tried all possible ways of creating class as:
    Class<?> c = ft.getClass(); OR
    Class<?> c = FieldTrouble.class; OR
                   /*Class<?> c = null;
                   try
                        c = Class.forName("org.struts.bean.FieldTrouble");
                   } catch (ClassNotFoundException e)
                        e.printStackTrace();
    Edited by: ..-__Kris__-.. on Feb 21, 2008 10:26 AM
    Edited by: ..-__Kris__-.. on Feb 21, 2008 10:26 AM

    Any hidden performance or memory issue here?
    Let us consider an object:
    public class SomeObject
         private String fieldA;
         private String fieldB;
         private String fieldC;
         private String fieldD;
         private String fieldE;
         //... say 50 declared fields....
         public SomeObject()
         public SomeObject(String fieldA, String fieldB)
              this.fieldA = fieldA;
              this.fieldB = fieldB;
    // getters and setters..     
    }When I create an object using the constructor with only two fields initialized such as the following code above, and look at what is happening to other fields as shown in the code below, I see that they are also AVAILABLE, now this is important, but they are set to null. What I wanted to know was, if I created an object with many fields, as many as 50 (getDeclaredFields = 50), and used a constructor with only two input fields to initialize an object, I still have 48 other fields available but set as NULL's. When I create more than 100,000 of these objects in a list and send to a .jsp page, I am unable to understand if this has more memory load than when you use a list of another object which has actually has only two declared fields in it. Each of this new object will have only two declared fields, when I say getDeclaredFields() it would return 2.
    This is where I am unable to figure out if this has anything to do with performance or memory, rather, what is the difference between the many possible ways you can initialize an object when there are too many fields which you probably won't use? Either create a new constructor with only two input arguments OR a generic constructor with all fields as input arguments but all those fields which you won't use assigned NULL's OR create another new object with only two declared fields
    SomeObject someObj = new SomeObject("abcd","cdef");
              Field[] fields = someObj.getClass().getDeclaredFields();
              System.out.println("Number of available fields: " + fields.length);
              for(int i = 0 ; i < fields.length ; i++)
                   try
                        fields.setAccessible(true);
                        System.out.println("Field " + i + ", with value: " + fields[i].get(someObj));
                        fields[i].get(someObj);
                   } catch (IllegalArgumentException e)
                        e.printStackTrace();
                   } catch (IllegalAccessException e)
                        e.printStackTrace();
              }Edited by: ..-__Kris__-.. on Mar 23, 2008 5:04 PM
    Edited by: ..-__Kris__-.. on Mar 23, 2008 5:05 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Can not access a member of class Test with modifiers ""

    Hi!
    I am trying to get a application into a applet, but I just get this errormessage:
    Exception: Java.lang.IllegalAccessException: Class sun.applet.AppletPanel can not access a member of class Test with modifiers ""
    Anyone that have any idea whats wrong here?
    Best regards Raymond

    Post class where the exception was ocurred.

Maybe you are looking for

  • How do I get iPhone movies into iTunes' movie menu in the sidebar?

    I've tried to get iPhone movies into iTunes, but they turn into .MOV files and won't transfer! I've tried exporting iPhone movie files from iPhoto into iTunes shared movie files (Movies folder), but they don't appear in the iTunes movie list!  They d

  • Query on Functionality of Transaction Category

    Hi Experts, Can you please explain the functionality of " Transaction category" with reference to Business transactions. For example, while opening the Telesales(TA) in the definition of Transactions, We select TA - Assignment of business transaction

  • Archiving Analysis

    I am trying to analyze the data to be archived by my company. Say I have archiving object MM_MATBEL, how do I determine how many documents I have per year (or some period) and how much space each period is taking up? Thanks, -- Jackie

  • Layout is not defaulted in ESS My Expenses

    Hi, I have gone to transaction POWL_QUERY to maintain the layout variant for FITV_POWL_TRIPS_EXP. After I saved the variant to be the default variant for all, I logged into ESS and try to access the query. However, the newly created variant layout is

  • Custom Style & Skin

    My company has several different dashboards running in production. Not all of these dashboards are related e.g Accounting, HR, Marketing. Is it possible to create a custom style and skin at the dashboard level that does not affect other dashboards.