visibility

Fast way to find visible components in JScrollPane

做~自己de王妃 提交于 2019-12-11 11:26:31
问题 Given a JScrollPane containing a thousand components using some LayoutManager . Each component can be either in a loaded or unloaded state. There are not enough resources for all to be loaded. I'd like to have only the visible components load() ed in memory, and the invisible components unload() ed. When the user scrolls, a listener needs to keep updating the components' states: unload() the previously visible, and load() the newly visible. At any given moment, how do I know which components

setVisible(false) to a group of JTextField and JLabel

与世无争的帅哥 提交于 2019-12-11 08:46:01
问题 I have a group of JTextField and JLabel . I want them to initially not be visible so I thought to initialize my applet with a method which calls setVisible(false) for each of the components. Is it possible to create a method setVisible(false) which will set the visibility of all the components to false. Finally if I have 40 components in the applet, is it possible to do this with only one command instead of 40 commands? 回答1: Add your buttons and labels to a JPanel and then you can simply make

ListView item visibility based on boolean

送分小仙女□ 提交于 2019-12-11 08:33:11
问题 I am trying to filter ListView Items based on input text, and because the selection is removed, I am trying to set visibilty to invisible based on a boolean(I hope this wont remove the selection of items) I used some older posts to create this code, but I can't figure out why it isn't working: <ListView x:Name="osebe_listView" Margin="0,0,40,0" SelectionMode="Multiple" SelectionChanged="osebe_listView_SelectionChanged" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Hidden">

Javascript for toggling visibility of table cell

谁都会走 提交于 2019-12-11 07:57:28
问题 I have a code which creates html reports. It uses html tables to display the results, the tables are sortable, and they are zebra striped automatically, so there is already Javascript and its all embedded inline, so that the file can be simply shared with its users. I don't have a great grasp of Javascript, and doing that already was hard enough. However, a problem now is that sometimes some of the cells have A LOT of data in them. It is by design however, and I am hoping to find an elegant

Visibility effects of synchronization in Java

丶灬走出姿态 提交于 2019-12-11 06:56:37
问题 This article says: In this noncompliant code example, the Helper class is made immutable by declaring its fields final. The JMM guarantees that immutable objects are fully constructed before they become visible to any other thread. The block synchronization in the getHelper() method guarantees that all threads that can see a non-null value of the helper field will also see the fully initialized Helper object. public final class Helper { private final int n; public Helper(int n) { this.n = n;

How to setVisibility in a listview by a button outside it?

只愿长相守 提交于 2019-12-11 06:46:08
问题 I have a custom Listview with 1 Button on a row I would like to add a button outside the Listview to set the visibility on button on all rows How can i achieve this? And i DONT wanna use notifyDataSetChanged that reload all data Anyone got an idea of this?? <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:id="@+id/notice_title" android

jQuery BootGrid - Hiding columns with data-visible=“false” removes from DOM

放肆的年华 提交于 2019-12-11 06:25:12
问题 With BootGrid, you can hide columns by using data-visible="false" in your th column definitions. This creates a problem in that, rather than just hiding the column, it appears to remove it from the DOM. Columns (First two do not show) <tr> <th data-column-id="id" data-type="numeric" data-identifier="true" data-visible="false">ID</th> <th data-column-id="User" data-visible="false">User</th> <th data-column-id="Title">Title</th> <th data-column-id="Description">Description</th> <th data-column

Linking to a section of a site that is hidden by a hide/show JavaScript function

淺唱寂寞╮ 提交于 2019-12-11 05:22:28
问题 I am using a bit of JavaScript to show/hide sections of a site when a tab is clicked. I'm trying to figure out if there is a way I can link back to the page and have a certain tab open based on that link. Here is the JS: var ids=new Array('section1','section2','section3','section4'); function switchid(id, el){ hideallids(); showdiv(id); var li = el.parentNode.parentNode.childNodes[0]; while (li) { if (!li.tagName || li.tagName.toLowerCase() != "li") li = li.nextSibling; // skip the text node

How I can selected by default an InternalFrame on a JDesktopPane?

风格不统一 提交于 2019-12-11 04:59:39
问题 I have a JFrame with the JDesktopPane and inside the JDesktopPane, I launch with the constructor a JInternalFrame. (Its a app like the authentification users, with the textbox user and textbox pass) I lauch the internal like this: MyInternalFrame internalF = new MyInternalFrame(); desktopPane.add(internalF); I try with: internalF.setVisible(true); internalF.setSelected(true); desktopPane.getDesktopManager().activateFrame(internal); desktopPane.setSelectedFrame(internal); How I can lauch the

GWT - Adding visibility true/false handler

混江龙づ霸主 提交于 2019-12-11 04:24:30
问题 Is there a simple way to add handlers/listeners to widgets so that the change to visibility can be detected ? Or do i have to create a system of my own ? (which means creating other widgets that wrap needed widgets and trigger events when setVisible(...) is called) 回答1: Standard widgets have their own listeners and handlers. If your application requires your own events then you have to define custom user defined events, listener and handlers. 回答2: overite setVisible(boolean visible) extend