JPanel not displaying in Windows

I have a window displaying a panel and some buttons. I installed the application on Solaris and Windows. On Solaris, it displays fine every time. On Widows, it displays the first time I bring up the application but the panel does not display when I close it and bring it back up. Has anyone seen this before. I've put some debugging statements in, but I have no idea where to start looking.
Thanks,
Josh

Here is the code that sets up the panel:
// Initialize and GUI implementation
private void jbInit() throws Exception {
try{
logger.fine("AudioEditPanel jbInit");
this.setLayout(new BorderLayout());
m_audioIcon = new ImageIcon(dataDir + File.separator + m_sAlertIcon);
TitledBorder curSettingBorder = new TitledBorder(m_sCurSetting);
TitledBorder soundBorder = new TitledBorder(m_sSound);
m_editPanel.setLayout(new BorderLayout());
// Create "Restore Default" button
m_defaultButton.setText("Restore Default");
m_defaultButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
     defaultButton_actionPerformed(e);
m_currentPanel.setLayout(new BorderLayout());
m_currentPanel.setBorder(curSettingBorder);
m_currentPanel.setPreferredSize(new Dimension(155, 165));
// Create customized tabel model
AudioTableModel tableModel = new AudioTableModel();
curTable = new JTable(tableModel);
//Set up column sizes.
initColumnSizes(curTable, tableModel);
// Only allows single selection
curTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
curTable.setBorder(BorderFactory.createLoweredBevelBorder());
curTable.setColumnSelectionAllowed(false);
curTable.getTableHeader().setReorderingAllowed(false);
setUpWavEditor(curTable);
//Fiddle with the Preview column's cell editors/renderers.
setUpPreviewColumn(curTable.getColumnModel().getColumn(preview_column));
// Add filter for the File Choose, so only Sound (*.wav) file
// can be used.
fc.addChoosableFileFilter(new WavFilter());
fc.setAcceptAllFileFilterUsed(false);
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
if (m_sDesDir != "") {
File wav_dir = new File(m_sDesDir);
fc.setCurrentDirectory(wav_dir);
fc.setDialogTitle("List of audio files");
m_assignPanel.setLayout(gridBagLayout1);
m_assignPanel.setBorder(soundBorder);
// "Selected Sound" label
SelectSoundLabel.setFont(new java.awt.Font("Dialog", 0, 10));
SelectSoundLabel.setForeground(Color.black);
SelectSoundLabel.setText("Selected Sound:");
//Click Browse button will pop up file chooser
browseButton.setActionCommand("Browse");
browseButton.setText("Browse");
browseButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
     browseButton_actionPerformed(e);
//Click preview button will play the sound defined in the sound text area
previewButton.setIcon(m_audioIcon);
previewButton.setMargin(new Insets(0, 0, 0, 0));
previewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
     previewButton_actionPerformed(e);
// selected sound text field.
sSoundText.setBorder(BorderFactory.createLoweredBevelBorder());
sSoundText.addActionListener(new ActionListener() {
public void actionPerformed (ActionEvent e) {
sSoundText_actionPerformed(e);
// "Preview" label
previewTextArea.setFont(new java.awt.Font("Dialog", 0, 10));
previewTextArea.setText("Preview");
previewTextArea.setForeground(Color.black);
// Use GridBag layout to put the components in the proper position
m_defaultPanel.add(m_defaultButton, BorderLayout.CENTER);
m_editPanel.add(m_assignPanel, BorderLayout.SOUTH);
m_assignPanel.add(browseButton, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,GridBagConstraints.SOUTHEAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 2, 0));
m_assignPanel.add(previewButton, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0,GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 2));
m_assignPanel.add(previewTextArea, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
m_assignPanel.add(sSoundText, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 3), 257, 2));
m_assignPanel.add(SelectSoundLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(3, 0, 6, 0), 6, 0));
m_curScrollPanel.getViewport().add(curTable, BorderLayout.CENTER);
m_currentPanel.add(m_curScrollPanel, BorderLayout.CENTER);
m_currentPanel.add(m_defaultPanel, BorderLayout.SOUTH);
m_editPanel.add(m_currentPanel, BorderLayout.NORTH);
m_tabbedPane.addTab(m_sAudioSetting, m_editPanel);
this.add(m_tabbedPane, BorderLayout.CENTER);
checkAudioPrefs();
}catch(Exception e){
e.printStackTrace();
System.out.println(e.getMessage());
}

Similar Messages

  • The Wireless Network tile is not displayed in Windows Mobility Center

    In my Vista X64 Enterprise that besides this behavior runs perfect i lose the The Wireless Network tile, Microsoft has even a KB about this see http://support.microsoft.com/kb/934555
    +The Wireless Network tile is not displayed in Windows Mobility Center on mobile PC that is running Windows Vista+
    Point is that i have the latest drivers (from Windows Update) on my MBP for my AR5008X and i installed the lastest bootcamp update (2.1) On a Fresh Vista installation the tile works for a day and then it's gone, it shouldn't disappear.
    How can i recover this tile, i turn of wireless often so i need this option!!?
    Message was edited by: piojo

    Nobody has the issue that when press Windows X (to get the mobility center) finding that the Wireless TILE is missing?

  • Not display main window of page

    Hi,
    My requiremnet is ,i want to display each sales order number in each page in layout.when am giving the input two sales orders,
    the first sales order (0001)dispaly its header and item details in main window finely but in second page it disaply the header data of second sales order number(0002) but does not read the main window and not display the item details of second sales order number(not showing the main window).i used the command option still not working.please tell me where i do a mistake.
    Waiting for ur reply..
    Regards,

    Hi ALI,
      When you are using command to trigger new page( In that you have to check the check box 'Go to new page' ) In this case the  the main window name of the first page and the next page shoul be same.If it is different then it will not trigger the main window of the next page. It displays the details of all other windows but main window details will not be displayed. Check this once.
    Regards,
    Rajitha.

  • Downloads are not displayed in window. I did change then change back destination folder.

    A window opens when files are downloaded but the file(s) are not displayed. They used to be

    See Tools > Options > Privacy > History: "Remember download history"
    To see all the History and Cookie settings, select: Tools > Options > Privacy > History: Firefox will: "Use custom settings for history"

  • WMode Transparent not displaying in Windows/Firefox

    Hello, I'm using Wordpress and a Wordpress flash plugin
    called Showtime Slideshow as the site's gallery. It works
    perfectly in the standard wmode=window setting in
    Firefox/Windows, but I have a dropdown menu that
    overlaps with the Flash. I was able to figure out the wmode
    needs to be opaque or transparent, but when I use those
    settings, nothing is displayed at all. It works fine in
    Windows/IE, Mac/IE and Mac/Firefox, so there is something
    in the code that Windows/Firefox doesn't like in this code
    (another Flash object from YouTube with wmode=transparent
    displays correctly).
    Here is the code that the plugin generates:
    <!-- generated by showtime WP plugin -->
    <script type='text/javascript'>
    var flashvars = {
    xml                : 'http://www.youtag.lu/youtagdesign/wp-content/plugins/showtime-slideshow/showtime/getxml.php?attr=id^433*source^medium*sourcehd^large*',
    width                : '674',
    height                : '448',
    classid           : 'st_0',
    rotationtime     : '5',
    transition          : 'SlideRight',
    transitiontime     : '1.5',
    transitionease     : 'BackEaseOut',
    autoplay          : '',
    showcontrols     : 'on',
    fullscreen          : 'on',
    showtext          : '',
    showalt               : 'on',
    shuffle               : '',
    scale               : 'noScale'              
    var params = {};
    params.allowFullScreen = 'true';
    params.bgcolor = '#EDEAE6';         
    params.quality = 'autohigh';         
    params.wmode = 'transparent';
    //params.base = 'dirname(__FILE__)';
    //params.allowScriptAccess = 'local';
    var attributes = {};
    attributes.styleclass = 'showtime';
    swfobject.embedSWF ('http://www.youtag.lu/youtagdesign/wp-content/plugins/showtime-slideshow/showtime/st15.swf', 'st_0', '674', '448', '10.0.0', 'http://www.youtag.lu/youtagdesign/wp-content/plugins/showtime-slideshow/showtime/swfobject/expressInstall.swf', flashvars, params, attributes);
    </script>
    [taken from the Showtime Slideshow demo page]
    Based on that code, can anyone see anything that
    would cause the whole slideshow to not display at all?    

    Bump. Could anyone take a look at the code?

  • Windows 8.0 taskbar properties navigation tab not displayed in windows 8.0

    When I click on taskbar properties it does not display a navigation tab in my windows 8.0 notebook like it does in my desktop 8.1 system. How do I get Windows 8.0 to display the taskbar properties navigation tab?

    Hi,
    Win8 taskbar properties doesn’t have the navigation tab, win8.1 add the new tab, what actions did you want to perform? Maybe we can to achieve it by other solutions.
    Regards,
    Yolanda
    Yolanda
    TechNet Community Support

  • Negative Value Fields Not Displaying on Windows XP / Adobe Reader 10+

    Hi,
    We have some PDF forms for invoices.  At the bottom of the forms, there is a table with various totals (items total, discount total, restocking fee, etc). 
    This is a pretty strange one to me.  Here is what I am seeing:
    If the dollar amount is negative in those totals, the dollar value will not show up.  It's only negative values, but it's consistent across all fields in this totals table.  I've confirmed this by manipulating values in the debugger.  So we would expect the table to look like this:
    Items Total: 10.00 USD
    Discount:    -1.00 USD
    Amount Due:   9.00 USD
    Instead we see:
    Items Total: 10.00 USD
    Discount:          USD
    Amount Due:   9.00 USD
    Even stranger, this only happens in our quality and production environments, not in our development environment.  It only happens when the user chooses to print preview, not if the output is triggered in the background.
    To further add to the confusion, it does not happen on Adobe Reader 9 or lower.  It does not happen on Windows 7.  This problem is reproducible only if the user is running Adobe Reader 10 and Windows XP.
    I'm reasonably confident this has something to do with ADS, but I don't even know where to start looking.
    Thanks
    Bryan

    The amount field in the interface is CURR 15.
    On the form, the amount field is a decimal field BUT this field is hidden.  The display field is defined as:
    Thanks,
    Bryan

  • Forms 6i help not displayed on Windows 7

    Hello to everyone!!
    A few days ago have installed Forms and Report 6i on my computer.
    Both Forms and Reports are working well, but the only problem I get is that the help (using the F1 key or accessing the help via the menu) is not displayed. The only thing I get to see is a Window error alert without any text.
    What must I do to get the "normal" Forms help screens?
    I hope that you can help me.
    Carlos

    HI,
    try to download windows help program from the following link
    http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=91
    if you can open the forms 6i help but there is nothing display in it
    you should locate the file then right click to open it's properties, click Unblock button and try to open help again.
    if this reply is helpful please inform us.
    regards,

  • Webi OpenDocument URL NAII=Y Not Displaying Prompt Window

    Hi everyone,
    I have a webi document with 2 prompts. The first is a mandatory prompt that is generated by a universe object. The object is named "Subtract Number Of Days Prompt" and when it is used in a query filter it will generate a prompt and then return current date minus the integer input at the prompt. We use it to run statements such as Today - <DYNAMIC NUMBER AS INPUTTED BY PROMPT>
    This is becasue my organisation dose not allow custom SQL.
    Ok, so I have Minus number of days becasue I want to look at any record <= (CurrentDate - 3 days).
    My second prompt is optional and is on Service State.
    I have the following URL to open the report:
    http://bi/OpenDocument/opendoc/openDocument.jsp?iDocID=AeVqxuUpApVLupgbup6_QC4&sIDType=CUID&sRefresh=Y&sType=wid&sOutputFormat=H&NAII=Y&lsSSubtract%20No.%20of%20days%20(0%20-%20999):=3
    Works Fine, the prompt is answered with 3 days but for some reason the prompt box is not displayed asking for the state prompt.
    I have this exact same URL format working for 7 other reports, only difference is that their state prompt is mandatory.
    I can trick it into forcing the prompt box using the following: (Service State:=?)
    http://bi/OpenDocument/opendoc/openDocument.jsp?iDocID=AeVqxuUpApVLupgbup6_QC4&sIDType=CUID&sRefresh=Y&sType=wid&sOutputFormat=H&NAII=Y&lsSSubtract%20No.%20of%20days%20(0%20-%20999):=3&lsSService%20State:=?
    But this opens up the prompt box with ? selected in the state.
    This means if you hit run query it gives a database error becasue ? is not a valid response for state.
    You have to either remove it to run for everywhere or select another state to run for a specific state.
    This is not the behaviour I want.
    I want the prompt box to open up so the users either hits run query leaving state empty or makes a selection and hits run to generate the report for the selected state.
    I have not been able to find anything on this issue or anyone else who has experienced it via hours of google searching so I appreciate any assistance anyone can offer.
    Cheers.
    Nick

    Testing with eFashion, a mandatory prompt and an optional prompt, I can make the optional prompt entry appear with:
    &lsSPromptText=?
    ..but this doesn't populate the prompt entry with a question mark, it leaves it blank.
    I have tried a few different permutations of checking / unchecking "Keep last value selected" and "Select only from list", but I can't seem to get the prompt entry to reflect the question mark from the URL - it always leaves a default entry box.
    NAII=Y determines if the Mandatory prompt shows in the prompt box when specified in the URL, as expected.
    See:
    lsS Prompt not passing through opendocument
    NMG
    XI 3.1 SP5 (12.5.3.1475)

  • Flash Adversitment not Displaying on Windows 8

    Hello ,
    I am webaster of  iwdownload. It is using Flash Ads but I found My Ads are not appearing on Windows 8 , Moblie browsers.
    Also, on other versions of windows, the embeded YouTube Video floats over the screen.
    Please help.

    Hello ,
    I am webaster of  iwdownload. It is using Flash Ads but I found My Ads are not appearing on Windows 8 , Moblie browsers.
    Also, on other versions of windows, the embeded YouTube Video floats over the screen.
    Please help.

  • Downloaded files with ActiveX not displays using Windows 8 and IE 11

    We are using ActiveX for downloading file from our server. After downloading ActiveX decrypt downloaded files. ActiveX works fine with all other IE versions but in case of IE 11, when we download the files ActiveX doesn't throw any error, but when we check
    the files at downloaded location, it looks like there was no files downloaded. When we the same process again using "IE 11 using "run as Administrator" the downloaded files displays at the downloaded location.
    After debugging, We didn't found error like "access denied or path not found or any other error." with or without Administrator mode. but still facing this issue.
    When we download file again using "Browse for Folder" it display the previous downloaded folders, but not exists at the actual location.
    Your quick reply will highly appreciated.
    Thanks

    Hi,
    on the user account.
    Tools>Manage Addons>Show all addons>Locate your custom download control in the list and double click it to display its properties.
    at the bottom of the Properties dialog there is a list of allowed sites. compare this with the settings on the Administrators account. The value should be the same as on the user account.
    If you are talking about the Akami Download manager from TechNet.
    Name:                   DLM Control
    Publisher:              Akamai Technologies Inc.
    Type:                   ActiveX Control
    Architecture:           32-bit
    Version:                2.2.6.2
    File date:              ‎Thursday, ‎28 ‎June ‎2012, ‏‎4:02 PM
    Date last accessed:     ‎Wednesday, ‎24 ‎October ‎2012, ‏‎9:23 PM
    Class ID:               {4871A87A-BFDD-4106-8153-FFDE2BAC2967}
    Use count:              3
    Block count:            1
    File:                   DownloadManagerV2.ocx
    Folder:                 C:\Windows\Downloaded Program Files
    it is only available in the x86 version.
    On server versions of windows you can only download software from MS on the Admin account. By default
    http://microsoft.com is mapped to the Trusted sites list...
    If possible please post back with the Properties of your custom AX download control from the Manage Addons dialog.
    Rob^_^

  • Photoshop CS 6 thumbnails not displaying on Windows 7

    Hi,
    I have Creative Suite CS6 and just got a new Dell. After reinstalling the suite I found old photoshop files displayed their thumbnails and keywords fine in Bridge and photoshop. The new photoshop files I save only show imagename.psd and I am not able to assign them keywords in Bridge. All other formats work fine am I missing a preference somewhere? I have looked, but no joy on my searches. Any help will be appreciated. Thank you in advance.
    Regards,
    Larry

    If it was a dll or msvc i should find an error in the eventlog. The only thing i got was a message box saying i need windows 7 to run is.
    My Xp sp3 workstations have all the critical and recommended patches. Besides i already run photoshop cs 6 on this machines. The only difference is that i downloaded this version from cloud connect. I assume its a newer version, but still cs 6 (13.x)

  • Some reports are not displayed in Windows Vista and IE9

    Hi,
    as the title says, I had a problem with Windows Vista.
    I'm using CR2008, VS2008, and .NET 3.5 to develop web form.
    So, in every computer (WXP, W7) with IE9 works fine, but in Win Vista, some reports are displaying in a wrong way.
    You can see a screenshot here
    http://dl.dropbox.com/u/27544299/bad%20cr.PNG
    SP2 installed.
    Any suggestion??
    Thanks.

    CR 2008 SP2 does not support IE 9.
    Upgrade to [CR 2008 SP5.|http://www.sdn.sap.com/irj/boc/support?rid=/webcontent/uuid/10e38d93-7f07-2d10-beae-e739182f8ada]
    - Bhushan.

  • Mini store will not display in window

    I recently cleaned out my PC by reverting a snapshot from 3 years ago. No iTunes then. I saved all the purchased music (bar one - rats!) and then re-installed iTunes.
    I am more or less back to where I was (have had to re-purchase the one track I didn't back-up) but I cannot seem to return to a display where the iTunes store is showing in the bottom 1/4 of the window. The window is open but the store is not connected. I used to like this facility. Can I get it back?

    I shouldn't think it is the firewall if you can connect to store and buy stuff. But if you suspect it you could try briefly diabling your firewall - not too dangerous if you use a router.
    The store has been pretty sluggish lately, at the moment I get a blank ministore for about 10 seconds after launch, then it comes up OK.

  • JPanel not displaying components

    i am working on a simple html renderer- at the moment all i am trying to do is to add JTextPane components to two different JPanels (search and content). I can add the text panes to the search bar, however none of the components are displayed in the content panel. I get no compile time errors, im really at a loss as to what the problem could be.
    this is the code im using-
    public class Demo extends JFrame
        private JPanel search, content;
        private JSplitPane splitPane;
        //private ArrayList<JTextPane> textCollection;
        //private ArrayList<JTextPane> preCollection;
        //specifies the universal font size the content JPanel
        private final int fontSize = 18;
        //specifies the universal font size for the search JPanel
        private final int searchFontSize = 9;
        /** Creates a new instance of Main */
        public Demo()
          this.setTitle("DEMO!");
          this.setDefaultCloseOperation(EXIT_ON_CLOSE);
          //sets default size
          this.setSize(500, 500);
          //init panel controls- these will hold all rendered controls
          search = new JPanel();
          //use BoxLayout to ensure controls are positioned correctly
          search.setLayout(new BoxLayout(search, BoxLayout.Y_AXIS));
          search.setBackground(Color.white);
          content = new JPanel();
          content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));
          content.setBackground(Color.white);
          //init JScrollPanes for both containers- allows for scrolling content of unlimited width/length
          JScrollPane contentScroller = new JScrollPane(content);
          JScrollPane searchScroller = new JScrollPane(search);
          //create a split pane container to contain both scroll panes
          splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, searchScroller, contentScroller);
          //search bar recieves 25% of screen size
          splitPane.setDividerLocation(this.getWidth() / 4);
          this.getContentPane().add(splitPane);
          //show controls
          this.setVisible(true);
        * Creates a new text component- text contained will be line wrapped as the user resizes the JFrame
        public void newText(String text)
          //init properites of new JTextPane
          JTextPane tp = newTextPane(text);
          tp.setBackground(Color.blue);
          //line wrap add to content panel
          tp.setFont(new Font("Times New Roman", Font.PLAIN, fontSize));
          tp = getLines(tp, this.getWidth() - splitPane.getDividerLocation());
          content.add(tp);
          //resize text for search panel, line wrap and add to search panel
          tp.setFont(new Font("Times New Roman", Font.PLAIN, searchFontSize));
          tp = getLines(tp, splitPane.getDividerLocation());
          search.add(tp);
        * Creates a new preformated text component- this will not be line wrapped
        public void newPre(String preformattedContent)
            JTextPane tp = newTextPane(preformattedContent);
            tp.setBackground(Color.red);
            //add to content panel
            tp.setFont(new Font("Courier New", Font.PLAIN, fontSize));
            content.add(tp);
            //resize text for search panel and add to search panel
            tp.setFont(new Font("Courier New", Font.PLAIN, searchFontSize));
            search.add(tp);
        * Small method that init's a JTextPane component with common properites used by the newText/Pre methods
        private JTextPane newTextPane(String s)
          JTextPane tp = new JTextPane();
          //set text
          tp.setText(s);
          //may not be editied
          tp.setEditable(false);
          //align correctly
          tp.setAlignmentY(Component.TOP_ALIGNMENT);
          tp.setAlignmentX(Component.LEFT_ALIGNMENT);
          //set maximum size to preferred size, this makes sure the JTextComponent will not "stretch" when the JFrame is resized drastically
          tp.setMaximumSize(tp.getPreferredSize());
          return tp;
        * Sets the appropriate preferred height & width of a given JTextPanel, essentially word wrapping any text contained within
        private JTextPane getLines(JTextPane tp, int paneSize)
          //get preferred size of the text panel - this is the smallest size the text panel may be and still visibly display its text content
          Dimension d = tp.getPreferredSize();
          double prefWidth = d.getWidth();
          double prefHeight = d.getHeight();
          //factor will determine if line wrapping is required
          double factor = prefWidth / (double) paneSize;
          //if factor is greater than 1, the preferred width is greater than the size available in the pane
          if (factor >= 1){
            //set width so that it matches the size available on the screen
            d.setSize((double) this.getWidth() - paneSize, factor * prefHeight);
            tp.setMaximumSize(d);
            tp.setPreferredSize(d);
          //else- do nothing! resizing is not required
          return tp;
         * @param args the command line arguments
        public static void main(String[] args)
          Demo d = new Demo();
          d.newText("this is some content ooh look content i hope this is long enough to test the wrapp esfsdfsdf sdf sdfsdfsd fsdf sdfsdfsdfd sfsdf sdfsdxf sdf sdf sdfsd fsd fsdf ing");
          d.newPre("a     pre          formatted           lump of    =  text! !  !");
        public void paint(Graphics g)
            super.paint(g);
            System.out.println("update called");
            //preferred.setSize(this.getWidth() - (this.getWidth() / 4), this.getHeight());
            //max.setSize(this.getWidth(), this.getHeight());
    }

    Do you need to keep adding JTextPane's to the content and search panes or do you just need to append text to the existing panes?
    If the later, you may want to create the JTextPanes in the constructor and use a set method to append/edit/remove text. As follows:
    import javax.swing.*;
    import java.awt.*;
    public class Demo extends JFrame
        private JPanel search, content;
        private JSplitPane splitPane;
        private JTextPane contentTextPane;
        private  JTextPane searchTextPane;
        //private ArrayList<JTextPane> textCollection;
        //private ArrayList<JTextPane> preCollection;
        //specifies the universal font size the content JPanel
        private final int fontSize = 18;
        //specifies the universal font size for the search JPanel
        private final int searchFontSize = 9;
        /** Creates a new instance of Main */
        public Demo()
          this.setTitle("DEMO!");
          this.setDefaultCloseOperation(EXIT_ON_CLOSE);
          //sets default size
          this.setSize(500, 500);
          //init panel controls- these will hold all rendered controls
          search = new JPanel();
          //use BoxLayout to ensure controls are positioned correctly
          search.setLayout(new BoxLayout(search, BoxLayout.Y_AXIS));
          search.setBackground(Color.white);
          content = new JPanel();
          content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));
          content.setBackground(Color.white);
          //init JScrollPanes for both containers- allows for scrolling content of unlimited width/length
          JScrollPane contentScroller = new JScrollPane(content);
          JScrollPane searchScroller = new JScrollPane(search);
          //create a split pane container to contain both scroll panes
          splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, searchScroller, contentScroller);
          //search bar recieves 25% of screen size
          splitPane.setDividerLocation(this.getWidth() / 4);
          /*add the textpanes to the JPanels*/
          contentTextPane = new JTextPane();
          content.add(contentTextPane);
          searchTextPane = new JTextPane();
          search.add(searchTextPane);
          this.getContentPane().add(splitPane);
          //show controls
          this.setVisible(true);
        * Creates a new text component- text contained will be line wrapped as the user resizes the JFrame
        public void newText(String text)
          //init properites of new JTextPane
          JTextPane tp = newTextPane(text);
          tp.setBackground(Color.blue);
          //line wrap add to content panel
          tp.setFont(new Font("Times New Roman", Font.PLAIN, fontSize));
          tp = getLines(tp, this.getWidth() - splitPane.getDividerLocation());
          content.add(tp);
          //resize text for search panel, line wrap and add to search panel
          tp.setFont(new Font("Times New Roman", Font.PLAIN, searchFontSize));
          tp = getLines(tp, splitPane.getDividerLocation());
          search.add(tp);
        public void addToContent(String text){
             contentTextPane.setText(text);
        * Creates a new preformated text component- this will not be line wrapped
        public void newPre(String preformattedContent)
            JTextPane tp = newTextPane(preformattedContent);
            tp.setBackground(Color.red);
            //add to content panel
            tp.setFont(new Font("Courier New", Font.PLAIN, fontSize));
            content.add(tp);
            //resize text for search panel and add to search panel
            tp.setFont(new Font("Courier New", Font.PLAIN, searchFontSize));
            search.add(tp);
        * Small method that init's a JTextPane component with common properites used by the newText/Pre methods
        private JTextPane newTextPane(String s)
          JTextPane tp = new JTextPane();
          //set text
          tp.setText(s);
          //may not be editied
          tp.setEditable(false);
          //align correctly
          tp.setAlignmentY(Component.TOP_ALIGNMENT);
          tp.setAlignmentX(Component.LEFT_ALIGNMENT);
          //set maximum size to preferred size, this makes sure the JTextComponent will not "stretch" when the JFrame is resized drastically
          tp.setMaximumSize(tp.getPreferredSize());
          return tp;
        * Sets the appropriate preferred height & width of a given JTextPanel, essentially word wrapping any text contained within
        private JTextPane getLines(JTextPane tp, int paneSize)
          //get preferred size of the text panel - this is the smallest size the text panel may be and still visibly display its text content
          Dimension d = tp.getPreferredSize();
          double prefWidth = d.getWidth();
          double prefHeight = d.getHeight();
          //factor will determine if line wrapping is required
          double factor = prefWidth / (double) paneSize;
          //if factor is greater than 1, the preferred width is greater than the size available in the pane
          if (factor >= 1){
            //set width so that it matches the size available on the screen
            d.setSize((double) this.getWidth() - paneSize, factor * prefHeight);
            tp.setMaximumSize(d);
            tp.setPreferredSize(d);
          //else- do nothing! resizing is not required
          return tp;
         * @param args the command line arguments
        public static void main(String[] args)
          Demo d = new Demo();
          d.newText("this is some content ooh look content i hope this is long enough to test the wrapp esfsdfsdf sdf sdfsdfsd fsdf sdfsdfsdfd sfsdf sdfsdxf sdf sdf sdfsd fsd fsdf ing");
          d.newPre("a     pre          formatted           lump of    =  text! !  !");
          d.addToContent("testing the content panel");
        public void paint(Graphics g)
            super.paint(g);
            System.out.println("update called");
            //preferred.setSize(this.getWidth() - (this.getWidth() / 4), this.getHeight());
            //max.setSize(this.getWidth(), this.getHeight());
    }If this is not the case let me know and Ill take another look. ;-)

Maybe you are looking for

  • HTML instead of text for the worksetItems of the SAPUI5 Shell

    How to put HTML for the worksetItems? Now, it is only text (example with the dashboard title): worksetItems: [new sap.ui.ux3.NavigationItem("WI_home",{key:"wi_home",text:"Dashboard"}), Do you know how to put HTML instead of text? I need it to to put

  • Mackeeper keeps asking for access to my confidential keychain information

    I recently updated my mackeeper account that was due for renewal and since doing so have been receiving the prompt below, about 5 times a day!!!!! After some research I decided to delete keychain from my apps, can anyone advice me on how to stop the

  • Reg:output determination in purchase order

    hi,    when i am creating purchase order i given all the details once i go for save the order it shows a pop up window " no message could be found for output of mesage save any way '. my requirement is how to avoid this popup message. i thing the pro

  • Table Widget. Inserting text, audio file and pdf file.

    Hi everyone, I have a client [Church organization] They want to put all their Sermon audio in their website. Similar to this: http://www.calvarysj.org/?page_id=1310 They have a lot audio files and I think I need to sort it by year or per book but goi

  • WLC 5508 Evaluation License Expiry

    Hi, I have a customer who wants to do some WLC migration works. They have a spare 5508 (50 License) that they want to use to house their 100+ APs during the migration works as they are temporarily decommissioning the active 5508s. They have asked me