This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 258649 - UI Freezes and becomes unresponsive after trying to add a component from palette or source package
Summary: UI Freezes and becomes unresponsive after trying to add a component from pale...
Status: RESOLVED INVALID
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Binding (show other bugs)
Version: 8.1
Hardware: PC Windows 10 x64
: P1 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-05 03:29 UTC by bo0m3r31337
Modified: 2016-04-05 10:01 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bo0m3r31337 2016-04-05 03:29:21 UTC
Basically, I wrote a new class called playlistPanel 

I go to my GUI builder and try to drag the playlistPanel from the view that has all my source files in the Source Packages dir, and then inside <default package>.  I grab playlistPanel.java from the list and attempt to drag it over into my GUI Builder design tab of my DeskTopGUI.java class.  This is the GUI builder I think. and then NetBeans UI freezes.  My task manager says it is running and using approx 55% of my CPU but the UI becomes completely unresponsive and I need a custom JPanel for my senior project :( please help me!
here is my code for my custom JPanel class. 

I also attempted to add my own custom constructor with no parameters and then I have right clicked and added it to my Palette and it still doesn't work!!
I don't know why! I have tried restarting my computer and everything.  Still no luck.

#############################################
public class playlistPanel extends JPanel{

private void doDrawing(Graphics g){
            Graphics2D g2d = (Graphics2D)g;
            //get height of panel
            int height = getHeight();
            //get width of panel
            int width = getWidth();
            for(int i = 0; i < height; i+= height/120){
                g2d.drawLine(0, i, width, i);
            }
    }
    
    @Override
    public void paintComponent(Graphics g){
        super.paintComponent(g);
        doDrawing(g);
    }

}
###############################################
Comment 1 Tomas Pavek 2016-04-05 10:01:55 UTC
I think you have created an endless loop in your playlistPanel (btw name of a class should start with a capital, so e.g. PlaylistPanel).

for(int i = 0; i < height; i+= height/120)

If height is less than 120 then height/120 is 0 and so i will not increase, the cycle will run for ever. That is likely what happened here.