Is there a way to obtain the name of the icons in the Windows Control Panel, and find out their coordinates?
One more question - if I have an application running and that contains buttons, is there a possible way to obtain the name of the button, as in string?
http://msdn.microsoft.com/en-us/library/ee330741(v=VS.85).aspx lists the "canonical names" of each control panel item. For example, Microsoft.DateAndTime for the one that sets your date and time. http://msdn.microsoft.com/en-us/library/cc144191(v=VS.85).aspx shows how to use WinExec (which you may or may not be able to use from Java, I don't know) to launch an item given it's canonical name, for example
WinExec("%systemroot%\system32\control.exe /name Microsoft.WindowsUpdate", SW_NORMAL);
There is quite a lot of community content on that page, indicating that perhaps it's a bit trickier than the documentation suggests. I suspect that getting your code to work smoothly on XP, Vista, and 7 may be frustrating.
The Mail icon is missing from MS's list.
This source indicates that it's canonical name is "Mail".
Check out: http://msdn.microsoft.com/en-us/library/bb776778(v=VS.85).aspx
Related
I have the following problem in my program which is created in eclipse luna with java 1.8.0
As you can see in the first part of the image the ip address is completely visible. However if you reduce the size of the bar, then the last characters are not shown anymore. (the 77 is missing in the first row) You can see that in the middle part of the image. However I would imagine that the ellipsis would appear directly. But they first appear when I am reducing the bar further on. In the last part of the image you can see that ip address has the ellipsis but the ip address does not. The IP Address would get the ellipsis as well if I would decrease the size more.
Is it a property I would have to set when I am creating the table? Or is it even a feature and not a bug? (For whatever reason)
Thank you very much for your help in advance.
I get the dialog for changing the properties of the print job by invoking the PrinterJob's printDialog() method without any parameter. There is a field where the user can change the the number of copies to be printed on the right-bottom of this dialog.
And now I want to disable this field (the spinner). That is only one copy to be printed and the user can't change it.
Are there any ideas for it
I don't think there is any way (or i am not aware of) to modify the native or the cross-platform Java print dialogs (last one might help you a bit). What you could do is maybe display your own dialog (without a spinner field) and under-the-hood do whatever you want (like PrinterJob.setCopies(1)).
More info i found here.
Also, have a look at the Java tutorial on PrinterJobs.
We have a requirement where we already have pre printed stationery and want user to put data in a HTML form and be able to print data on that form. Alignment/text size etc are very important since the pre-printed stationery already has boxes for each character. What could be a good way to achieve this in java? I have thinking of using jasper reports. Any other options? May be overlay image with text or something?
Also we might need to capability to print on plain paper in which case the boxes needs to be printed by our application and the form should match after the printed with the already printed blank stationery containing data.
Do we have some open source framework to do such stuff?
Jaspersoft reports -- http://sourceforge.net/projects/jasperreports/
You will then create XML templates, then you will be able to produce a report in PDF, HTML, CSV, XLS, TXT, RTF, and more. It has all the necessary options to customize the report. Used it before and recommend it.
You will create the templates with iReport then write the code for the engine to pass the data in different possible ways.
check http://www.jaspersoft.com/jasperreports
Edit:
You can have background images and overlay the boxes over it and set a limit on the max character size ... and many more
It is very powerful and gives you plenty of options
Here is one of iReport's tutorial for a background image http://ireport-tutorial.blogspot.com/2008/12/background-image-in-ireport.html
The big problem when printing form content that has been filled in electronically, is aligning it correctly on the pre-printed form. You may get content to align for one printer, but when you use another it is completely misaligned.
Fly Software have a form design product called InForm Designer that gets around the problem nicely by allowing users to specify and save vertical and horizontal offsets for printers. This ensures filled in form content is always aligned. I've tried it and it works perfectly. Take a look for yourself here...
http://www.flysoftware.com/products/inform_designer/overview.asp
It might be worth implementing a printer offset similar to InForm's in your own application (if possible).
Some things to think about.
First in terms of the web page, do you want use the stationery as the form layout?
Does it have to be exact?
Combed boxes (one for each character)
Do you want to show it like that on the web page, or deal with the combing later.
How are you going to deal with say a combed 6 digit number. Is this right aligned. What if they enter 7 digits. Same for text. what if it won't fit.
Font choices, we had a lot of fun with W...
How aligned do you want the character within the box, what font limitations does that imply, some of the auto magic software we looked at did crap like change the size of each character.
Combed editing is a nightmare, we display combed, but raise an edit surface the size of the full box on selection.
Another thing that might drive you barking mad, you find find small differences in the size and layout of the boxes, so they look okay from a distance but a column of boxes sort of shifts about by a pixel. Some of testing guys had to lend us their electron microscopes, so we could see how many ink molecules we were out by. :(
Expect to spend a lot of time in the UI side of things, and remember printed stationery changes, so giving yourself some sort of meta description of the form to start with will save you loads of trouble later on.
I will explain my question clearly.
I need to zoom in/zoom out the world map.
When I click on the particular country in map, control should redirected to new page with respective the country.
I dont have any idea about this in java. Please explain the steps to acheive the above task.
As the question is quite general, here is a general answer: Zooming often means, that you want to display a certain percentage of somethin, and not the whole, where your size of the displayed will not change.
But in your case it seems more like a "find a mouse click in a polygon" thing. So you have to add a selection/click listener to whatever widgets you use (Swt? swing? ....?) where you change what your program renders.
It sounds like you may be trying to reinvent the wheel. Google etc have already solved this problem rather well. It might be better to incorporate an existing solution into your application. Have a look at GoogleEarth inside Java Swing.
In the application that I am working on, there is tabular data (for the record, it is a Java Swing app using JTables). In some cases the data is sortable by clicking on the column headers.
What I want to know is what is a good way to indicate to the user if a given column is sortable or not?
I have come up with the following possibilities.
1) Put an icon in each sortable column indicating it is sortable. I personally do not like this option.
2) Change the mouse cursor into something else when it hovers over the header to indicate it is sortable.
3) Put a note in the tooltip text when hovering over the column saying that it is sortable.
Does anyone have any other suggestions?
Update:
I think a clarification is in order.
My question is not how does one indicate that a given column is currently sorted. That is already implemented via the up/down sort triangle paradigm.
I want to give the user a clue as to which columns can be sorted before they click on the header to sort it.
Update 2:
I think I should explain why I'm not entirely sold on option #1. It seems to me that if one is going to put an icon to indicate which columns are sortable then this will add to visual clutter. In such cases, sometimes the UI changes on "mouse over". Case in point: Windows Vista and 7 allows one to add a filter on a column yet the indicator for this does not appear until you hover over the header with the mouse.
When you're dealing with the UI, you have to put your mind into what the user will expect. I would almost always recommend staying with the paradigms that your users will expect. Therefore I would recommend a version of option 1)
RememberME's post describes how this could work - You can still use arrows in column headers - one option would be to put an arrow icon in the header, but change the state of that icon if it was sorted (e.g. highlight the up or down button if the dataset is currently sorted by this column.)
Edit:
A Windows Explorer example may not be the best example here. My original text quoted below:
In Windows Explorer and almost all
form datagrids there is a small icon,
usually an up or down arrow, that
indicates that a column is sortable.
Experiment with Windows Explorer to
see the way in which this works.
In many apps, triangles indicate sortable so I think that's the best way to convey the information to the user b/c it's a standard they're most likely familiar with.
I think the jquery plugin from DataTables.Net is a good example. You could take a look and see if you like the look/functionality of that and emulate it. Both an up and a down indicate sortable. Just one or the other indicate that it is being sorted. If they column is not sortable, there is no icon at all. Their example also changes the pointer from an arrow to the hand pointer to indicate that you can click on the header.
I think the standard way is essentially option 1: either display the data initially sorted with a little arrow pointing either up or down (ascending/descending), or sort+display the icon as soon as the column header is clicked.
I think having a little arrow or triangle icon below the column heading, which you can click to sort by that column is the best option, as it is easy to see visually and very intuitive to use.
Little triangular up/down sort icons are pretty much standard for sortable table views in desktop applications and web pages. You may not like them, but your users are probably used to them (even if they don't realize it).
You should of course change the mouse cursor over clickable elements.
You should always do 2 for anything clickable.
Number 1 is not bad, typically a triangle pointing up or down depending on the sort order.
To indicate clickability, you could also use blue, underlined text on sortable columns and plain dark gray text on nonsortables -- the http link appearance is a well-known device to virtually all users, but it would not convey sortability, per se. Rather, a user might expect clicking that to take them to some other screen or list, as a hyperlink typically does.
I may be a little dense, but what kinds of columns are not sortable?
Pretty much anything can be sorted; even if there is no strict "greater than" relationship, at least there will be an "equals", and then sorting simply means "bring equal things together".
Strings? Try alphabetical ordering. Images? Sort by percentage of red, green, blue (or if you want to get fancy, compare color histograms). Locations? Use distance to Rome or any other arbitrary location.
Sorting on some columns may be much more useful than sorting on others; but I have a hard time finding a column type were it is important to avoid sorting from taking place.