Focus controls with-in JWindow from JFrame
public class MyWindow extends javax.swing.JWindow{
private javax.swing.JTextField myTextField;
public MyWinodw(){
myTextField = new javax.swing.JTextField();
addWindowFocusListener(new java.awt.event.WindowAdapter() {
@Override
public void windowGainedFocus(java.awt.event.WindowEvent e) {
//When this window gets focus, put focus in the text field.
myTextField.requestFocus();
}
});
//Other stuff like size setting, layout setting etc.,
getContentPane().add(myTextField);
validate();
setVisible(true);
}
}
and in my JFrame object, I tried to request focus like this.
MyWindow myWindowObj = new MyWindow();
myWindowObj.requestFocusInWindow();
But to my surprise with no compilation error, text field was not getting focus.
With little googling somewhere I read that JWindow will have a parent and if we didn’t supply one, it will take a null parent. I made a guess and used other constructor of JWindow where we can pass a container.
I used the constructor JWindow(Frame)
and called super constructor.
Thats all. It worked.
Error 1001 in PHP Manager 1.2 for IIS 7
To avoid this, make sure that you opted to On the IIS Management Console in Windows Features like this
Add .settings folder to ignore list in Netbeans
- Right click on the file
- Go to Subversion > Ignore
However if you want to add a particular file (which is not visible in projects tab) like bin folder, build.xml etc., to ignore list of Subversion in Netbeans, it is a bit tricky.
- Go to Files tab
- Right click on the file / folder
- Go to Subversion > Ignore
Complex thing is to add a file / folder (which is not visible either in projects tab / files tab) like .settings folder etc., to ignore list of subversion in Netbeans, it is not straight forward. For this, you have to
- Right click on the project
- Go go Subversion > Svn Properties
- There double click on property svn:ignore visible in Subversion Properties
- Add .settings to the list and click on Update and then Close.
That is all you have to do.
DBML : The entity type [Table Name] does not belong to any registered model.
<asp:GridView ID=”Menu1″ runat=”server” AutoGenerateColumns=”false”
The non-generic type ‘System.Collections.IList’ cannot be used with type arguments
The non-generic type ‘System.Collections.IList’ cannot be used with type arguments
OR
The non-generic type ‘System.Collections.IEnumerable’ cannot be used with type arguments
OR
The non-generic type ‘System.Collections.ArrayList’ cannot be used with type arguments
based on the type of argument you used.
To avoid this issue
Use the corresponding base classes available in System.Collections.Generic namespace viz
System.Collections.Generic.IList for System.Collections.IList
System.Collections.Generic.IEnumerable for System.Collections.IEnumerable
and
System.Collections.Generic.List for System.Collections.ArrayList
DBML – The specified module could not be found – HRESULT:0x8007007E
As specified here (Extracted the working solution and copied here for quick reference)
The problem seems to be with the Visual Database Tools DLL.
This DLL file is installed by the VS 2010 installation, but during a SQL Server 2012 installation, it will be upgraded to the SQL 2012 version of the tools. Thereafter, uninstalling and reinstalling SQL or VS will not remove this newer DLL in order to allow the older version to be installed, and hence leave this annoying issue.
How I fixed it was I set up a clean virtual machine and installed VS 2010, then took this original DLL from my virtual machine and overwrote the DLL on my live machine. Simple as that.
I would assume though that deleting this DLL file and then doing a VS 2010 repair or uninstall/reinstall would also fix the problem.
The directory and file name of the DLL (on an X64 machine) is: C:\Program Files (x86)\Common Files\microsoft shared\Visual Database Tools\dsref80.dll
Download dsref80.dll
Search for dsref80.dll in visual database tools folder (Generally C:\Program Files\Common Files\microsoft shared\Visual Database Tools) and replace with the downloaded file
Removed Bookmarks apears again in Firefox
Recently I deleted few bookmarks from Bookmark Manager (inside Library) and later they appeared again when I type some URL in the address bar.
After many days I got an idea where I opened the suggested (removed) bookmark URL and then from the address bar I removed the bookmark by clicking on the “star” icon and then using “Remove Bookmark” button.
Now the removed bookmarks are not coming again. Still confused about the strange behavior of Firefox.
Ignoring .settings, .project, .classpath etc., files and folders in SVN Commits in Eclipse
Finally I found an option to ignore these files and folders while committing the projects. Here is how to do that.
Go to Windows > Preferences > Team > Ignored Resources and Add Pattern like this
not marked as executable error in Jar file execution
The file ‘[JAR File Path]’ is not marked as executable. If this was downloaded or copied from an untrusted source, it may be dangerous to run. For more details, read about the executable bit.
To run that jar file, run it from terminal using java -jar [JAR file path]
OR
Create a shortcut on the desktop like this
Right click > Create New > Link to application
Under Permissions tab, provide permissions to others by clicking on the Advanced Permissions button
Provided application particulars in application tab
In command, provide java -jar ‘[JAR file path]’