selection

Java Swing JTable select programmatically multiple rows

淺唱寂寞╮ 提交于 2019-12-04 07:33:50
I have a JTable with multiple rows and every row is presented via Point on a scatter plot. What I have to do is when a given point is selected on the scatter plot I have to associate this selection with selecting of the corresponding row in the JTable. I have an Integer that represents, which row I have to highlight. What I tried is: JTable table = new JTable(); ... ...// a bit of code where I have populated the table ... table.setRowSelectionInterval(index1,index2); So the problem here is that this method selects all rows in the given range [index1,index2]. I want to select for example rows 1

Mysql select with Where and default if where condition not present

故事扮演 提交于 2019-12-04 07:02:29
问题 I have tables Product and productDetails. In productDetails I have rows with description of product in many languages (discriminated by lang column). Not every product will have description in every language. How to make a selection that will select the description in the specified language (by Where productDescription.lang = 'en' ) and that will select a description in a default language if the specified language is not present (descriptions with default language are always present). I made

How to get markers inside an area selected by mouse drag?

一个人想着一个人 提交于 2019-12-04 06:59:55
In Brief I want to find all the markers which lie within a rectangular area created by dragging the mouse over the map. Is this feature supported by any jQuery plugins or something else? If not, I would like to implement this in my project. I think it would be cool. Details I am using Google Maps v2 because I want to support IE 6 in my project. I am a beginner in Maps and went through the Developer's guide section and some basic demos and other SO questions. Here is my idea so far - User clicks on a "Select an area" button in the controls section of the map. This calls disableDragging() and

Java swing: selecting/deselecting JButton to imitate pulsing

我的未来我决定 提交于 2019-12-04 06:58:52
问题 f.e. I have an email client, it receives new message, button with incoming messages starts doing something, until user clicks it to see whats up. I'm trying to make button attract attention by selecting, waiting and then deselecting it, but this does nothing! do{ button.setSelected(true); Thread oThread = new Thread() { @Override public void run() { synchronized (this) { try { wait(1000); } catch (InterruptedException e1) { e1.printStackTrace(); } } button.setSelected(false); } }; oThread

Get Chosen App from Intent.createChooser

血红的双手。 提交于 2019-12-04 06:25:08
I am trying to capture the result of Intent.createChooser to know which app a user selected for sharing. I know there have been a lot of posts related to this: How to know which application the user chose when using an intent chooser? https://stackoverflow.com/questions/6137592/how-to-know-the-action-choosed-in-a-intent-createchooser?rq=1 How to get the user selection from startActivityForResult(Intent.createChooser(fileIntent, "Open file using..."), APP_PICKED);? Capturing and intercepting ACTION_SEND intents on Android but these posts are somewhat old, and I am hoping that there might be

UITextView link selectable without rest of text being selectable

大兔子大兔子 提交于 2019-12-04 05:43:17
I'm trying to get a setup similar to what Facebook use (if they use a UITextView ). I want links to be detected automatically however I don't want any other text in the UITextView selectable. So, the user can click on the link but is unable to select any other text. Despite searching around, I've yet to come across a solution as for link selection to work it requires the whole of the text view to be selectable. This answer is for iOS 10.3.x and below where your UIView is not embedded in a subview. For a more robust, modern answer, please see Cœur's answer below . You need to prevent the

Hide/Show rows based on multiple dropdown selections (filtering)

蓝咒 提交于 2019-12-04 05:16:01
So my question is this. I have a table and I am hiding/showing rows based on a dropdown menu selection. What would like to have is the 2 menus working together rather than independently. If I select an item in the first dropdown, I would like to be able then to filter that item further with the second dropdown and so on with any additional dropdown. Here's the code I'm using that works independently currently. <script> $(document).ready(function(){ $('select#age').bind('change',function(){ if($(this).val()=='Show All'){ $('td.age').parent().show(); }else{ $('td.age').parent().hide(); $('td.age

Changing styles when selecting and deselecting multiple polygons with Leaflet/Shiny

和自甴很熟 提交于 2019-12-04 04:18:56
I'm having some problems changing polygon styles when selecting and deselecting polygons in a Leaflet Shiny app I'm working on. In my current app, when you click on a polygon, that polygon is highlighted with a different color. Ideally, I want the user to be able to select and highlight multiple polygons. I also want the user to be able to re-click a single highlighted polygon to deselect it. The best that I've been able to manage is to select multiple polygons, give them the same group ID "selected", then deselect that entire group when a polygon is re-clicked. Here's some example

Listbox datatemplate - item only selectable by clicking a subelement, not just anywhere on the item

妖精的绣舞 提交于 2019-12-04 04:17:53
I have a listbox with a datatemplate for the items. The problem is that selecting an item doesn't work by just clicking anywhere on the item; I have to click on a specific sub-element for it to actually work. My item has an image and a textblock. If I hover the mouse over the image or text-block, I actually see the hover-effect. If I hover the mouse over any of the 'empty' space of the item, no hover effect (and no selection when I click there). Example image : http://i33.tinypic.com/wvtleg.png If I click on (or hover over) the actual text or the image it works fine, but if i hover my mouse in

UIButton with UITableViewCellSelectionStyleGray Selection Color

♀尐吖头ヾ 提交于 2019-12-04 03:42:31
问题 I am trying to set the selected color for a UIButton to the color of 'UITableViewCellSelectionStyleGray'; The problem is that the selection color of a UIButton cannot be set, only the image. Does anyone know how to make an image that is the exact color of a selected cell with UITableViewCellSelectionStyleGray? 回答1: Unfortunately I can't seem to find the actual color programmatically but DigitalColor Meter (OSX APP) says the color is 217 217 217 UIColor* selectedColor = [UIColor colorWithRed