Design problem(split pane scrollpane Insets)

hi,
doing a exam simulator prgm
design is like,
Question (text area with scrollpane)
Answers (checkbox inside panel with scrollpane)
used split pane between qst and ans but big thick bar comes how to reduce size and it is not
moving.
used GridLayout for container and panel.
PROBLEM is how to leave space qst textarea appears from very left edge of screen how to leave some space
same prblm for checkbox they to appear extreme left on screen.

Put those components in a JPanel overwriting the getInsets() method like this:
JPanel cPane=new JPanel(){
    private final Insets _insets=new Insets(10,10,10,10);
    public Insets getInsets(){
        return _insets;
};...should do the trick, take a look at the Insets class if you need information on how defining it...

Similar Messages

  • Split Pane Problem

    I have a panel with a split pane in it. On the Left hand side there is a Tree and on the right side is a complex tabbed pane.
    (complex meand it includes many panels, more tabbed panes and other components).
    My problem is this. I have given a specific width for the split pane for the tree and at start time it comes corrcetly. But when I move the Split pane left, suddenly it jumps to the left edge of the screen. And then I cant move it forward again. Tree cannot be seen now.
    Why does this happen I just cant figure out.
    Is it because of tabbed panes or something with the split pane.
    Another thing is when I try to move the split pane to the left the movements are not smooth. It kind of do smaller jumps, until it do that big jump to the edge.
    Any help would be greatly appreciated....

    Seeing that your file has a size of 3.5 Mb, I preferred not to download it, but to send you this link.

  • I can't type in the design portion of split pane view.

    When I try to type in the design portion of split pane, the design pane becomes white and won't except any input.  Basically it is forcing me to do everything in the code portion of the pane.

    It is dreamweaver CC for Mac OS X.  Yes, I have done that.  Here's a picture to illustrate what is happening:
    BEFORE:
    I place my cursor after the last bullet point, "Status" in the design pane.  When I hit Enter on my keyboard to create another bullet point (at least this is how it worked in previous dreamweaver versions) this is what I see:

  • Design problem with JScrollPane

    First, I have problems with english. I hope u understand without problems that Im trying to say here. Sorry about that.
    Mi problem is whit a JScrollPane. I want to put an image whit a predefined size for draw inside it. I dont have any information about it, just the size. I want to put it in a JPane. The best choice is use the JPane area. The problem is that I want to use a JScrollPane because the image is bigger that the visualization area.
    Im unable to put a Canvas in the ScrollPane, or a JPane whit a predefined size or an image whit a predefined size. Im sure that is a design problem. Somebody can tell me something I can start whit? What do u think is better choice to put inside a JScrollPane?
    I dont send any source code because I dont have anything else that is show in the example.
    Gracias.

    import java.awt.*;
    import javax.swing.*;
    import java.net.URL;
    public class Test extends JFrame {
      String url = "http://www.sandbox-usa.com/images/product_images/2piece_16.gif";
      public Test() {
    //    System.getProperties().put( "proxySet", "true" );  // uncomment if you have proxy
    //    System.getProperties().put( "proxyHost", "myproxy.mydomain.com" ); // Your proxyname/IP
    //    System.getProperties().put( "proxyPort", "80"); // Sometimes 8080   
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);   
        Container content = getContentPane();
        try {
          Image i = Toolkit.getDefaultToolkit().getImage(new URL(url));
          JLabel jl = new JLabel(new ImageIcon(i));
          content.add(new JScrollPane(jl), BorderLayout.CENTER);
          setSize(200, 200);   
          setVisible(true); 
        } catch (Exception e) { e.printStackTrace(); }
      public static void main(String[] args) { new Test(); }
    }

  • Design problem: RS232 communication

    Hi,
    I have a design problem for communication with a device via RS232. Since I'm normally a C++ programmer I might just look at the problem from a wrong angle and hope for some hints how to do it in LabVIEW.
    The scenario:
    A device is communicating with the PC via RS232. The device permanently sends data packets. At the same time, commands can be sent to the device and it returns replies. Data packets and reply packets are arbitrarily mixed, i.e. after sending a command there could be a couple of date packets before the reply comes back but the packets can be distinguished by an identifier.
    At least one, ideally several VIs should communicate with the device. Commands should be sent by pressing buttons and the incoming data should be parsed (the packets contain mutliple data streams) and shown on graphs or saved to files.
    My initial idea:
    Coming from C++ I wanted to build a class for the communication that permanently reads the incoming data and splits it to reply and data packets. This class would then have a function to send out a command and would return the reply or a timeout and it would be possible to register and unregister listeners (I wanted to use queues for this) for the various data streams.
    The problems I ran into:
    There were a couple but the two most pressing problems were: how could I communicate with the constantly running sample VI (e.g. to stop sampling) and how could I propagate changes to the class to it (e.g. new listeners). Since it is not returning I don't see a good way to implement it as in instance funcion (i.e. pass it the object). I could probably not let the sample function run continously but call it periodically from outside. However I planned to implement the class as a singleton, so it could be used parallely from different VIs.
    Is there a best practice for a case like this?
    I'm glad about any hints or ideas.
    Thanks,
    Tobias

    tfritz wrote:
    Hi,
    thanks. Since almost the same thing was suggested to me in a German forum I guess this is really common practice (using one VI with different methods controlled by a queue). It still seems a little "unnatural" for me but my biggest concern (bad interface description) was shattered by the suggestion in the link you sent me to wrap these functions with wrapper VIs, thus caller VIs won't have to deal with the call-by-queue-mechanism. This might also be easier to port to a different implementation later. However I still see the danger that the continously running VI could easily become bloated. 
    It also requires me to change the way I have looked at VIs until now. In our course they told us that VIs are basically functions. Using this design patterns, the VI becomes more of a module, really (Like a C module implemented in a C-Source file). But I will try it. It sounds as if it could work.
    I will still look into the OOP solutions a little more, though. Do I understand you correctly that you wouldn't recommend using LVOOP because it's still buggy? What about dqGOOP for example? This sounds like it could do what I need (however it doesn't seem to implement things like polymorphism, late binding and inheritance so I don't quite see what's so OOP about it. It seems more like programming with structures in C.)
    I don't know if LVOOP is buggy or not.  I think early on it was buggy and things have improved in recent versions. I have read that it doesn't have all the features that you would have in OOP like C.  I wouldn't recommend it only because I'm not familiar with it at all.  I can't recommend something that I'm not comfortable with.  If you go that route, plan on spending time in these forums and in LAVA to reading up on what others have done.  I haven't hard of dqGOOP.
    But back to your suggestion. I still have a couple of questions:
    - How do you return values from the module? Would you use a queue for that as well?
    - Where would the parameter queue be held (created and passed to the VI)
     I would store all of these in a functional global variable.  This is the VI that stores data in shift registers.  Ben's action engine nugget is an advancement on that.  This allows for both the calling VI and the parallel running subVI to get and set the data as needed.  It runs quickly so neither process should be forced to wait while the other  VI is doing its thing.
    - My VI has to be constantly sampling and this shouldn't be interrupted too long by other functions as adding a listener. However both functionalities have to access the same kind of data. Is there an easy way to parallelize this? Would the sampling be a case in the case diagram that's always used if no command was sent to the VI or would it somehow run parallely?   Yes.  There are a couple of ways of doing this.  One would be for the dequeue to have a timeout function.  In the event the dequeue times out, you run the code that is doing the acquisition.  I think a better method is that the code that does the acquisition enqueues its own command again to the end of the queue.  Let's say that is command A.  So when case A finishes, it enqueues A, which seeds itself to run again.  So if nothing else comes into the queue, it just executes A , A, A, A.  But let's say another section of code needs to do something such as command B.  It will slip B into the queue while A is executing.  So you would A, B, then A again, because A would get slipped back into the queue when the first A finishes, but B has already been put in while the first A was running.
    - Would it be possible to make the VI reentrant and in this way use it simultaneously on different COM ports (using different parameter queues as well)? I'm not sure if I will need this but it would be neat if it could work.
    I think you could do this.  It may be a case where the VI is saved as a template  (.vit) and you initiate it multiple times.  I haven't needed to do this before, so I'm afraid I can't provide any details or useful tips. 
    Well, I will fool around some more. Thanks so much for your help. This is kind of exciting since the concepts are quite new for me. Btw, is there something like an academic theory (computer science) for LabVIEW? I came across functional languages in university but data flow languages are still a new concept for me.
    Tobias
    tfritz wrote:
    Another question about the "dynamically starting" of the VI:
    How is the path handled? Is it guaranteed that it always takes the VI from the project or does it just search for the first VI by that name it finds in the file structure? Does this still work when building an .exe from the project? What happens if the VI is already running? Can you test for this?
    While I'm at it: is there a way to stop LabVIEW from searching for subVIs it can't find when openin a VI? This resulted in very unexpected behaviour sometimes where it would find the VI somewhere else (with the same name but maybe an older version).
    In my case, I just had the path hardcoded.  It is my only instance, I'm not planning on moving the VI's.  If you don't have the path, it will take a VI by that name if it's in memory.  If it isn't in memory, it starts searching relative to the calling VI's path.  One thing I know, if you are dealing with relative paths, a subVI has a different relative path in an .exe as opposed to the development environment.  The name of the .exe becomes a folder.  So in development, if your sub VI is mySubVI.vi.  In an executable, its path is MyExe.exe\MySubVI.vi
    For all of this, I recommend searching the forums to get more details.
    If it is searching for a VI, you can hit ignore.  But of course you'd have to do it before it finds it.  When you are dealing with versioning issues, I recommend making a backup copy of the entire directory structure elsewhere.  Some location where it shouldn't stumble across it.

  • Split Panes, Frame and Resizing

    Hi,
    my user interface is made up of a message panel using the created class SplitPanes2 through the method createSplitPanes called from a class that extends Frame. (will post code if required: lengthy). When the frame is resized/maximized, the splitPanes remain at their preferred size. How can I work on it such that the SplitPanes will resize proportionally too? Please inform me if I have overlooked certain details.
    -cyndi
    public class AppLayout {
         Frame parent;
         public AppLayout() {
         public void createSplitPanes( Panel messagePanel, TextArea messageAreaOut, TextArea messageAreaIn, TextArea messageArea ) {
              Panel splitPane2 = new SplitPane2( messageAreaOut, messageAreaIn, messageArea );
              messagePanel.setLayout( new GridLayout(1, 1));
              messagePanel.add(splitPane2);
         public class SplitPane2 extends Panel {
              public SplitPane2( TextArea messageAreaIn, TextArea messageAreaOut, TextArea messageArea ) {
                   //Create an instance of splitPane
                   splitPane sPane2  = new splitPane( messageAreaOut, messageAreaIn );
                   JSplitPane left    = sPane2.getSplitPane();
                   //XXXX: Bug #4131528, borders on nested split panes accumulate.
                   //Workaround: Set the border on any split pane within
                   //another split pane to null. Components within nested split
                   //panes need to have their own border for this to work well.
                   left.setBorder( null );
                   //Create a split pane and put "left" (a split pane)
                   //and TextArea instance in it.
                   JSplitPane sPane   = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT,
                        left, messageArea );
                   //splitPane.setOneTouchExpandable(true);
                   sPane.setDividerLocation( 150 );
                   sPane.setResizeWeight( 0.5 );
                   //Add the split pane to this frame
                   sPane.setPreferredSize( new Dimension( 400, 430 ) );
                   add( sPane );
              class splitPane {
                   JSplitPane sPane;
                   public splitPane( TextArea messageAreaOut, TextArea messageAreaIn ) {
                        //Read image names from a properties file
                        sPane = new JSplitPane( JSplitPane.VERTICAL_SPLIT,
                             messageAreaIn, messageAreaOut );
                        //splitPane.setOneTouchExpandable(true);
                        sPane.setDividerLocation( 0.5 );
                        sPane.setResizeWeight( 0.5 );
                        //Provide a preferred size for the split pane
                        sPane.setPreferredSize( new Dimension( 150, 350 ) );
                   public JSplitPane getSplitPane() {
                        return sPane;

    Hi, I'm not sure, but I think I had a similar problem. I tried to place a JSplitPane inside a JPanel and then I got the same behaviour as you describe. Unfortunately I didn't find out why that happened. I simply didn't use the JPanel and then it worked as I wanted it to. (Almost) :)

  • Why was the split pane removed from Acrobat?

    I recently upgraded from Acrobat 9 to Acrobat 11, and find that I'm not able to be as productive in 11. It's much harder to perform reviews because the Comment pane is difficult to work with. By default, the Comment pane is too narrow to be useful. If I undock it to try to put it underneath the document, I have to spend time fiddling with my windows to try to get the document the right size so that the undocked Comment pane can appear below it. The split pane was so much easier to work with; I hope that it will be added back in a future release. One other problem is that the scroll bar in the Comment pane is so narrow, it's difficult to click it.
    Can anyone suggest any workarounds to help deal with these new features?

    I tried the Touch Mode, which could probably help if I was viewing PDFs on a tablet, but unfortunately, it didn't do anything to increase the width of the Comment pane scroll bar, which is the UI element that I'm finding too narrow.
    I would have thought that Adobe's main customers would be using review and comment features heavily, so it's disappointing to see these types of UI changes made.
    As a workaround, I'm finding that I can at least split the page text, undock the Comment pane, and have it cover the bottom pane. That's a bit easier than trying to get it to fit under a resized main window. With most software that allows undocking, it usually lets you dock to a different spot, which would have worked fine here for those of us who would like to keep the comments at the bottom of the screen for better readability.

  • Adobe reader XI - Split Pane feature to be implemented?

    Hello,
    is it possible to implement the split pane function in adobe reader?
    We already use the window-> new window feature but it would be great to have the split function so that we can manage only 1 pdf instead of 2, and it is quite more efficient to do cross references.
    Thanks.

    Hello Pat,
    You are absolutely the BEST.
    I followed your two recommendations and now the program is working perfectly. Yes, my Reader XI was version 11.0.10 when I was having the problems.
    I never would have figured out the solution to the problem without your help.  I was very pleased with your follow through. 
    I really appreciate your help.  THANK YOU! – THANK YOU!
    Adobe is a great program – I have used it for years and this is the first time I have had any problem.  
    Kind regards,
    Hartley

  • Split Pane Divider and Fixing.

    Hi there fellow swingers. I am having trouble (you could say pane) with a divider.
    I basically want the user to be able to maximise and minimise a split pane but nothing in between.
    so, I want mySplitPane.setOneTouchExpandable(true);but I do not want them to be able to move the split pane by dragging it.
    using mySplitPane.setDividerSize(0); does not work as this will get rid of the scrollpane bar.
    Any help is appricaiated in advance.

    splitPane.setEnabled( false );

  • Form pane X split pane

    I have an application with a JSplitPane in the center of the GUI.... in this split pane I have a left JTree and a right JPanel.
    on te JPanel on the right I have a form based on GridBagLyout, but it is very unstable... when I drag the split divider, sometimes te form becomes messy... with some fields over the other....
    some tip ?

    1 GridBagLayout is better than N-LayoutManagers ?Neither is better, which is why you have a choice. I prefer using whatever yields the easiest code to understand and maintain. For me this is usually a combination of the "basic" Layout Manager (ie. those Layout Managers without complex constraints)
    is that really necessary to adopt more than 1 LM ?I don't know, but you did ask the question because you are having problems using just a single Layout Manager.
    Either way there is no way we can offer specific advice because we have no idea what your form looks like.
    I suggest you read this before posting any further:
    http://www.physci.org/codes/sscce.jsp

  • Split pane only shows buttons, not the panes I placed there

    problem: my split pane only shows buttons, not the panes I placed there
    here's my complete code:
    thanks.
    * MLDpane.java
    * Created on July 23, 2003, 3:31 PM
    import javax.swing.*;
    import javax.swing.tree.*;
    * @author  Administrator
    public class MLDPane extends JSplitPane {
        private JScrollPane jScrollPane2 = new JScrollPane();
        private JTextPane ttView = new JTextPane();
        private JScrollPane jScrollPane3 = new JScrollPane();
        private JTree treeView = new JTree();
        private  void init() {
            setDividerSize(5);
            //setPreferredSize(new java.awt.Dimension(600, 302));
            //jScrollPane2.setMinimumSize(new java.awt.Dimension(100, 20));
            //jScrollPane2.setPreferredSize(new java.awt.Dimension(300, 300));
            //ttView.setPreferredSize(new java.awt.Dimension(300, 22));
            jScrollPane2.setViewportView(ttView);
            setLeftComponent(jScrollPane2);
            jScrollPane3.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            //jScrollPane3.setMinimumSize(new java.awt.Dimension(100, 20));
            //jScrollPane3.setPreferredSize(new java.awt.Dimension(300, 200));
            treeView.setModel(null);
            jScrollPane3.setViewportView(treeView);
            setRightComponent(jScrollPane3);
         public MLDPane() {
        /** Creates a new instance of MLDpane */
         public MLDPane(MedLEEDoc mld) {
            init();
            ttView.setDocument(mld.getTextDoc());
            treeView.setModel(new DefaultTreeModel(mld.getRoot()));
        public static void main(String args[]) {
            JFrame j = new JFrame();
            j.getContentPane().add(new MLDPane());
            j.show();
            //j.setVisible(true);
            //j.setExtendedState(j.MAXIMIZED_BOTH);

    Hi,
    I think you are invoking the default (no argument constructor) instead of the one argument constructor
    try this:
    j.getContentPane().add(new MLDPane(MedLEEDocObject));

  • Design problem with Swing

    Hi all. I've run into some design problems when trying to create a Swing app.
    I've got a non-graphical class that emulates a power supply unit. Let's call it PSUnit. I have to create a GUI for PSUnit.
    Every class designed to build a full GUI app uses PSUnit in some way (changes its voltage, displays voltage, turns it on, turns it off, etc.)
    Here's the catch. Suppose I've got a class:
    public class BuildingBlock extends JPanel {
         // code includes a JTextBox displaying
         // the current PSUnit voltage.
    }another class is created for setting the voltage:
    public class AnotherBlock extends JPanel {
         // this class contains a JSpinner and
         // a button that retrieves the JSpinner value
         // and sets it as the current voltage of
         // PSUnit
    }When the button in AnotherBlock is clicked, I must notify the BuildingBlock class that a PSUnit has changed its state so it can update it's values and display the correct data.
    I've tried to do this a few times but failed miserably, so I'm hoping you guys could help me out.
    Please note that both of the above classes have some additional code and it's not very pleasant to make one class an inner class of another. I should be able to create a "standalone" classes which, combined together, form a GUI for PSUnit.
    Thanks.

    Yes this is a common problem that many of us have when building UIs
    Here's the question: In this instance, are these two classes really independant? Could they stand alone? Often when building a GUI, it's not even that easy to answer that question, but these leads to the two ways you can solve this
    #1. Make them independent, and use listeners either using Observable / Observer or creating your own custom listeners. The advantage of this is smaller classes and more independence. The disadvantage is it's generally more complicated, especially at the design stage
    #2 (what I'd probably recommend). Make 1 GUI class "MyPSFrame", then declare your panel classes as inner classes within that class. This way, everything goes into one spot, and everything is shareable. This also makes sense if you can't have 1 of the panels without the other.

  • Design problem about repreatable entity relationships

    Hi all!
    As I design the data model (let's name it the ERD, no matter the name is quite unfashonable), I have found almost identical structures of entities and relationships between them, but playing completely different roles in the semantics of the model.
    It obviously makes no sense to implement all such entities separately as the Entity EJB as they are to share most of the fields and methods, but I found no "handsome" solution when trying to implement them as sets of classes and interfaces forming "the abstract EJBs", and then by putting the conrete classes and complementary interfaces at the final packages to create "concrete EJBs". The problem was about types returned by the createXXX and findXXX methods, because they had to return the "abstract" EJBs but the EJB programming contract forces them to return the "concrete" ones, that are unknown to me when defining the "abstract ones". So it cancels the sense for creating them this way. It was also unclear how to operate the relationships in such model.
    The idea was:
    1. I define BaseSthLocalHome extends EJBLocalHome
    2. I define BaseSthLocal extends EJBLocalObject
    3. I define BaseSthBean implements EntityBean
    ... this way I have the "abstract bean", and then I can create many:
    SthOneLocalHome extends BaseSthLocalHome,
    SthOneLocal extends BaseSthLocal,
    SthOneBean extends BaseSthBean ... to have the first "concrete" EJB,
    SthTwoLocalHome extends BaseSthLocalHome... and so on to create the second, third and all the next "concrete" EJBs.
    Anyway, it did not work fine as I defined createXXX and findXXX methods at the BaseSthLocalHome interface - it made sense, because those methods did not depend on the other entities.
    Has anyone some idea of how to solve the design problem? Currently we are at very beginning of the project, so we have some "case study" time, and I would appreciate any solution: redesign of the data model, extraction of new EJB modules or any use of the objective inheritance.
    Thanks in advance!
    Marcin Gawlik

    Again me - I now it is a bad idea to reply for own messages, but I have just checked a new idea:
    The problem was about re-using the same components in different roles. I tried to do that by creating subclasses of the EJB classes, but it did not work. So I tried to define multiple entity EJBs that have the same class.
    Considering the given example, it would look:
    1. public interface BaseSthLocalHome extends EJBLocalHome
    2. public interface BaseSthLocal extends EJBLocalObject
    3. public abstract class BaseSthBean implements EntityBean
    ... then I created the deployment descriptor that deploys this pack of class and interfaces as three separate CMP Entity Beans:
    1. deploy BaseSthBean as the SthOne CMP entity EJB
    2. deploy BaseSthBean as the SthTwo CMP entity EJB
    3. ... and so one
    The question is: IS THERE ANY CONTRA FOR THIS WAY OF DEPLOYING EJBS? Is there any reason for not to use the same class and its complementary interfaces many times to create many separate enity EJBs working within the same EJB module?
    Thanks in advance!
    Gaw

  • Design problem/Ex​ercise Book

    Hi Everyone,
                       I am new to Labview. I just started with Labview 2011 student edition and I am following Bishop's book. But I also want a tutorial book with lots of design problems and exercises to get my skills. I am a postdoc in purdue and I started learning LabViews just because I want to learn (I am facinated by the G programming. I use it in my instrument but the departmental engineers wrote it and I want to have the same type of skills. I am also intending to become CLD). Can anyone suggest me any book or any website where I can find exercises and design problem? Thank you everyone.
    Cheers!
    Solved!
    Go to Solution.

    Ekram wrote:
    Hi Everyone,
                       I am ...Can anyone suggest me any book or any website where I can find exercises and design problem? Thank you everyone.
    Cheers!
    You found it!
    Get involved answering questions (gird up your loins) and let others hammer you into submision. Don't fall into the trap of writing code and posting VIs on demand, but rather post images of how you want to solve the posted question and let others feedback.
    Have fun!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Design problem: Central MessagePool in WebDynpro App.

    Hi people,
    I have a design problem in my webdynpro application:
    I'm designing an application with different DC's. The architecture of the application is similar to the architecture described in the document "Web Dynpro Component
    Interface Defintions in Practice SAP NetWeaver ’04s": One root DC which manages the differnt child DC's, which contain the application content.
    Now I want to have a central MessagePool. Certain Messages in the child DCs are the same, and I don't want to have multiple MessagePool-entries for the same Message (each child DC has to define its own messages).  I can't  use the root DC as central MessagePool, because the Child DCs havn't access to the root-DC.
    Any idea, how to define and use a central MessagePool?
    Regards,
    Thomas

    Hi Thomas,
    Instead of the architecture what you are thinking try the architecture explained in the following link:
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f4d79e59-0601-0010-0689-89670315bc6b">link</a>
    Dont forget to award points on helping answers
    Regards
    sid

Maybe you are looking for