So I installed Eclipse on my laptop, and started a new school project. My program runs fine until I add a JTextfield, when I do that it will only show a empty grey JFrame instead of the JFrame with all my components in it. If I remove the line of code with the JTextfield it is all shown again when I run. Also with the JTextfield line the JFrame is grey, until I resize the window, then everything is shown fine.. but I dont wanna have to resize my JFrame every time I run it..
First I was running Java 7, so downgraded to Java 6 but am still having the same problem...
so adding this:
JTextField txtMyField = new JTextField(10);
myFrame.add(txtMyField);
will mess things up, and removing these 2 lines of code will make it work again..
I have tried making a new project, it works fine until I add a textfield.
I tried a new workspace in eclipse, works fine until I add a textfield..
Whats going on here?
Try this, make the jframe visible myjframe.setVisible(true); after adding all the swing components.
Without your exact code i can only assume however.
if you call myFrame.add(txtMyField); you are adding it at the same level as the JPanel. try this
JPanel panel = new JPanel();
JTextField field1 = new JTextField(10);
panel.add(field1)
JTextField field2 = new JTextField(10);
panel.add(field2);
add(panel);
this will add 2 textfield to a panel and the panel to the frame.. the panel by default as a FlowLayout which will float them together see here to other layouts.
Related
I've been upgrading my Kendo version recently, and upon the change, one of my tests broke. It tries to select an area over a kendo chart. Previously, it worked just fine. However, with the new Kendo version, the test fails. It lines up the mouse over the beginning and end of where it should be selecting, but it is not selecting anything. Here is the snippet of code that should be selecting the chart area:
new OpenQA.Selenium.Interactions.Actions(WebDriverContext.Current)
.ClickAndHold(zoomToElement).MoveToElement(zoomFromElement)
.Release(zoomFromElement).Perform();
Has anyone else encountered this issue?
I'm new to vb.net and need some help.
I'm not sure what's happening but a deleted main form loads on start up even after setting a new form as start up.
I took a few buttons and copied it on a group container and named it Dial Pad on the old form. After testing to see if it works I adjusted the dimensions and ran again but this time it stayed the same. I clicked on the buttons but nothing happened. Check the code and there was code in it and correct. However there seem to be other set of buttons name as same but with a 1 at end.
I checked the solution explorer and it didn't show, only the originals showed. After frustration I created a new form and copying the code and created new controls. I deleted the old problematic form and set the new one as start up but the old form with the dial pad still appears and only exit button I added and coded works. The datagridview on old forms works as well and is the old way I can get to the other forms which still work.
This problem sometimes indeed occurs. The solution is pretty simple. Go in the menu to Build > Clean Solution and rebuild. Or else, open the context menu on the solution node and select Clean Solution.
Screenshot of the menu:
Screenshot of the solution node context menu:
I had the same problem with a web page in VB. Rebuilding website/solution didn't work for me. The only things that worked were 1. Completely restarting VB or 2. File -> Close Solution and then loading it again File -> Recent Projects and Solution. This one at least spares some time.
So I have this application I have made in VB. The problem is that when I start it it does not show up in my taskbar. It only shows up if I maximize another window infront of it and then minimize it. Also it has the basic VB icon even though I changed the icon in the properties.
There is no relevant code for this issue.
I found the same thing; no icon was showing in the taskbar. I had to go into Task Manager and Switch To the program to get it to show. I could ' maximize another window in front of it and then minimize it as well.'
Found the solution that worked for me. The 'Main' form did not have anything in the 'text' property because I was doing that and a Ver number in the program. As soon as I put text into the 'text' property, it started working. The problem was only with VB2015. Worked fine in VB2010.
I have a weird issue with getURL.
I'm using the following command in an AS2 project and it's popping up a new window (without toolbars etc) instead of opening an entirely new tab in my browser. Is there a setting or something in cs 5.5 or is it something to do with the embed code? I've never seen this before!
getURL("http://www.google.com", "_blank");
There s no any new settings for as2 on cs5.5.
I have encountered a problem in a Flex application.
I have implemented drag and drop support from a List to a Canvas, and I DragManagers doDrag() - with.a proxy-image. In my custom DragDrop event handler, i place a new item on the Canvas. I use the event.localX/localY to position the new item.
It is working ok, but the problem is that I want the "new" image to appear exactly where the proxy-image is when i release the mouse button (x/y -wise).
Can I somehow get the proxys X,Y location. I thought that DragManager would have a reference to it but I can´t find it.
Thanks
/C
Even though I save a ref to the proxy-object, it´s values are reset (naturally) in the drag-drop method.
I have found the answer by using the event.localX/Y variables.