A man tried to get into a flat in Dalbeattie uninvited while partially clothed and carrying a knife.
James Pickthall tried the door handle of a neighbouring flat and attempted to put his hand through the letterbox. The 38-year-old then took off the rest of his clothing. At Dumfries Sheriff Court, Pickthall, described as a prisoner at Dumfries, admitted behaving in a threatening manner at Craignair Flats in Dalbeattie in September.
He also admitted trying to enter a neighbouring flat uninvited and being in possession of a lock knife.
Fiscal depute Jennifer McGill told the court that the neighbour thought Pickthall was trying to break into the flat and was very alarmed.
Solicitor David Orr said Pickthall was ashamed about what happened and thought he was trying to get into his own door.
Sheriff Brian Mohan pointed out that Pickthall had a record and jailed him for 20 months.
A man has been accused of attacking his pregnant partner, compressing her throat and rendering her unconscious to her severe injury and the danger of her life.
Robert Taylor, 31, pleaded not guilty to the charge which also alleged that he repeatedly punched and kicked her on the head and body, struck her head against a cot, hit her on the head and body with a bottle and put a broken bottle to her neck.
In addition Taylor denied behaving in a threatening manner to the woman at Dee Avenue in Castle Douglas in July, shouting and swearing, accusing her of cheating on him and threatening to kill her.
Trial was set for December and Taylor, described as a prisoner in Barlinnie, lodged a plea of self-defence.